diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-12-09 15:06:47 -0700 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-01-21 08:28:06 +0000 |
commit | a7c42b25455d589ae6e13fc636a6d83632c3d39f (patch) | |
tree | 75e656776a743645d47aa61cd34f87eec45d7154 /drivers/mfd | |
parent | 01e73c89cf03c020e586dc9e30d52a6e098853f6 (diff) | |
download | linux-a7c42b25455d589ae6e13fc636a6d83632c3d39f.tar.gz linux-a7c42b25455d589ae6e13fc636a6d83632c3d39f.tar.bz2 linux-a7c42b25455d589ae6e13fc636a6d83632c3d39f.zip |
mfd: Always assign of_node in mfd_add_device()
mfd_add_device() assigns .of_node in the device objects it creates only
if the mfd_cell for the device has the .of_compatible field set and the
DT node for the top-level MFD device contains a child whose compatible
property matches the cell's .of_compatible field.
This leaves .of_node unset in many cases. When this happens, entries in
the DT /aliases property which refer to the top-level MFD DT node will
never match the MFD child devices, hence causing the requested alias not
to be honored.
Solve this by setting each MFD child device's .of_node equal to the top-
level MFD device's .of_node field in the cases where it would otherwise
remain unset.
The first use-case for this will be aliases for the TPS6586x's RTC
device.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/mfd-core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 267649244737..32e8d47d9002 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -117,6 +117,8 @@ static int mfd_add_device(struct device *parent, int id, } } } + if (!pdev->dev.of_node) + pdev->dev.of_node = parent->of_node; if (cell->pdata_size) { ret = platform_device_add_data(pdev, |