From: Sudeep Holla Date: Fri, 29 Apr 2022 11:39:45 +0000 (+0100) Subject: firmware: arm_ffa: Add ffa_dev_get_drvdata helper function X-Git-Tag: howlett/maple/20220722_2~450^2~15^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=498af8d1678ae2351218337b47bbf3cb0fc16821;p=users%2Fjedix%2Flinux-maple.git firmware: arm_ffa: Add ffa_dev_get_drvdata helper function Add a helper function to fetch ffa_dev's driver_data using dev_get_drvdata. At the same time move existing ffa_dev_set_drvdata to use dev_set_drvdata. Link: https://lore.kernel.org/r/20220429113946.2087145-3-sudeep.holla@arm.com Suggested-by: Arunachalam Ganapathy Signed-off-by: Sudeep Holla --- diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index 85651e41ded86..e5c76c1ef9edf 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -38,7 +38,12 @@ struct ffa_driver { static inline void ffa_dev_set_drvdata(struct ffa_device *fdev, void *data) { - fdev->dev.driver_data = data; + dev_set_drvdata(&fdev->dev, data); +} + +static inline void *ffa_dev_get_drvdata(struct ffa_device *fdev) +{ + return dev_get_drvdata(&fdev->dev); } #if IS_REACHABLE(CONFIG_ARM_FFA_TRANSPORT)