MFD: mcp-sa11x0: convert mcp-sa11x0 to use platform resources
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 20 Jan 2012 23:09:42 +0000 (23:09 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 3 Feb 2012 17:38:07 +0000 (17:38 +0000)
commit45c7f75fd4b57035cd35954986a2faefb07dac9d
tree1cab7610cd45d2b38334f62c49406a1b74ecdabe
parentc4592ce4e8f69d78711d53f0a42ec1b4dbf00cde
MFD: mcp-sa11x0: convert mcp-sa11x0 to use platform resources

Patch taken from af9081ae64 (ARM: sa1100: Refactor mcp-sa11x0 to use
platform resources.) by Jochen Friedrich <jochen@scram.de>, and fixes
applied.

We can safely do this now that we have sanitized host removal; the
original patch had use-after-free bugs in the removal code.  Not only
that, but there was no checking of the ioremap() return.

The final change over Jochen's patch is that we wrap the base pointer
selection inside the various register indexes, which reduces the
possibility of the wrong register index being used.

Acked-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-sa1100/generic.c
drivers/mfd/mcp-sa11x0.c