* [PATCH] spmi: Auto-populate driver.owner in spmi_driver_register()
@ 2015-09-10 22:06 Stephen Boyd
2015-09-22 16:47 ` Andy Gross
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Boyd @ 2015-09-10 22:06 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Andy Gross,
Gilad Avidov
Populate the owner field of the spmi driver when
spmi_driver_register() is called in a similar fashion to how
other *_driver_register() functions do it. This saves driver
writers from having to do this themselves.
Cc: Andy Gross <agross@codeaurora.org>
Cc: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
drivers/spmi/spmi.c | 5 +++--
include/linux/spmi.h | 4 +++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index 11467e17bdd8..6b3da1bb0d63 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -560,12 +560,13 @@ EXPORT_SYMBOL_GPL(spmi_controller_remove);
* This API will register the client driver with the SPMI framework.
* It is typically called from the driver's module-init function.
*/
-int spmi_driver_register(struct spmi_driver *sdrv)
+int __spmi_driver_register(struct spmi_driver *sdrv, struct module *owner)
{
sdrv->driver.bus = &spmi_bus_type;
+ sdrv->driver.owner = owner;
return driver_register(&sdrv->driver);
}
-EXPORT_SYMBOL_GPL(spmi_driver_register);
+EXPORT_SYMBOL_GPL(__spmi_driver_register);
static void __exit spmi_exit(void)
{
diff --git a/include/linux/spmi.h b/include/linux/spmi.h
index f84212cd3b7d..1396a255d2a2 100644
--- a/include/linux/spmi.h
+++ b/include/linux/spmi.h
@@ -153,7 +153,9 @@ static inline struct spmi_driver *to_spmi_driver(struct device_driver *d)
return container_of(d, struct spmi_driver, driver);
}
-int spmi_driver_register(struct spmi_driver *sdrv);
+#define spmi_driver_register(sdrv) \
+ __spmi_driver_register(sdrv, THIS_MODULE)
+int __spmi_driver_register(struct spmi_driver *sdrv, struct module *owner);
/**
* spmi_driver_unregister() - unregister an SPMI client driver
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spmi: Auto-populate driver.owner in spmi_driver_register()
2015-09-10 22:06 [PATCH] spmi: Auto-populate driver.owner in spmi_driver_register() Stephen Boyd
@ 2015-09-22 16:47 ` Andy Gross
0 siblings, 0 replies; 2+ messages in thread
From: Andy Gross @ 2015-09-22 16:47 UTC (permalink / raw)
To: Stephen Boyd
Cc: Greg Kroah-Hartman, linux-kernel, linux-arm-msm, linux-arm-kernel,
Gilad Avidov
On Thu, Sep 10, 2015 at 03:06:20PM -0700, Stephen Boyd wrote:
> Populate the owner field of the spmi driver when
> spmi_driver_register() is called in a similar fashion to how
> other *_driver_register() functions do it. This saves driver
> writers from having to do this themselves.
>
> Cc: Andy Gross <agross@codeaurora.org>
> Cc: Gilad Avidov <gavidov@codeaurora.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
Reviewed-by: Andy Gross <agross@codeaurora.org>
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-22 16:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-10 22:06 [PATCH] spmi: Auto-populate driver.owner in spmi_driver_register() Stephen Boyd
2015-09-22 16:47 ` Andy Gross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).