Laxman,
On Mon, Jul 14, 2014 at 02:04:55PM +0200, Lucas Stach wrote:
Am Montag, den 14.07.2014, 16:42 +0530 schrieb Laxman Dewangan:This is my understanding too. MFD device drivers must populate the
There are some mfd devices which supports junction thermal interruptThis seems like the wrong way around. If the MFD has subdev information
like ams,AS3722. The DT binding of these devices are defined as the
flat and drivers for sub module of such devices are registered as
the mfd_add_devices. In this method, the sub devices registered as
platform driver and these do not have the of_node pointer on their
device structure. In this case, use the parent of_node pointer to
get the required of_node pointer.
Signed-off-by: Laxman Dewangan <ldewangan@xxxxxxxxxx>
---
drivers/thermal/of-thermal.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 04b1be7..85a7d71 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -396,6 +396,8 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id,
return ERR_PTR(-EINVAL);
sensor_np = dev->of_node;
+ if (!sensor_np && dev->parent)
+ sensor_np = dev->parent->of_node;
for_each_child_of_node(np, child) {
struct of_phandle_args sensor_specs;
stored in the parent node it should be the MFD drivers responsibility to
populate the subdev of_node with its own node. The subdev should not be
forced to make such possible unsafe assumptions.
required data onto their sub devices while creating them.