summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-21 09:28:53 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-21 15:46:25 +0000
commit2a7f51a3e08cdaeea78d9e101a0079422a55bbc3 (patch)
treeaa7bd825268bcd0438f502dbf90de03844cf90c5 /include
parent98250221691f728b7cad6deed98866f8847e683f (diff)
downloadlinux-2a7f51a3e08cdaeea78d9e101a0079422a55bbc3.tar.bz2
MFD: mcp-core: fix mcp_priv() to be more type safe
mcp_priv() does unexpected things when passed a void pointer. Make it a typed inline function, which ensures that it works correctly in these cases. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/mcp.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h
index ee496708e38b..f88c1cc0cb0f 100644
--- a/include/linux/mfd/mcp.h
+++ b/include/linux/mfd/mcp.h
@@ -64,6 +64,9 @@ void mcp_driver_unregister(struct mcp_driver *);
#define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device)
#define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d)
-#define mcp_priv(mcp) ((void *)((mcp)+1))
+static inline void *mcp_priv(struct mcp *mcp)
+{
+ return mcp + 1;
+}
#endif