Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1351553 > unrolled thread
| Started by | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| First post | 2016-03-07 12:40 +0100 |
| Last post | 2016-03-14 19:20 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] spmi: do not use bus internal data Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-03-07 12:40 +0100
Re: [PATCH] spmi: do not use bus internal data Stephen Boyd <sboyd@codeaurora.org> - 2016-03-14 19:20 +0100
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2016-03-07 12:40 +0100 |
| Subject | [PATCH] spmi: do not use bus internal data |
| Message-ID | <ra1G1-2fN-5@gated-at.bofh.it> |
The variable p is a data structure which is used by the driver core
internally and it is not expected that busses will be directly accessing
these driver core internal only data.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---
Reference of Greg's comment about it at:
https://lkml.org/lkml/2016/3/5/171
drivers/spmi/spmi.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index 6b3da1b..2b9b094 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -25,6 +25,7 @@
#define CREATE_TRACE_POINTS
#include <trace/events/spmi.h>
+static bool is_registered;
static DEFINE_IDA(ctrl_ida);
static void spmi_dev_release(struct device *dev)
@@ -507,7 +508,7 @@ int spmi_controller_add(struct spmi_controller *ctrl)
int ret;
/* Can't register until after driver model init */
- if (WARN_ON(!spmi_bus_type.p))
+ if (WARN_ON(!is_registered))
return -EAGAIN;
ret = device_add(&ctrl->dev);
@@ -576,7 +577,14 @@ module_exit(spmi_exit);
static int __init spmi_init(void)
{
- return bus_register(&spmi_bus_type);
+ int ret;
+
+ ret = bus_register(&spmi_bus_type);
+ if (ret)
+ return ret;
+
+ is_registered = true;
+ return 0;
}
postcore_initcall(spmi_init);
--
1.9.1
[toc] | [next] | [standalone]
| From | Stephen Boyd <sboyd@codeaurora.org> |
|---|---|
| Date | 2016-03-14 19:20 +0100 |
| Message-ID | <rcFfY-7qA-19@gated-at.bofh.it> |
| In reply to | #1351553 |
On 03/07, Sudip Mukherjee wrote: > The variable p is a data structure which is used by the driver core > internally and it is not expected that busses will be directly accessing > these driver core internal only data. > > Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> > --- Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web