mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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>
This commit is contained in:
parent
9825022169
commit
2a7f51a3e0
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue