diff options
author | Grant Likely <grant.likely@linaro.org> | 2014-11-04 10:26:26 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-02-20 23:41:22 +0900 |
commit | 9f1e7cdb9fd3cfa9bef604eb26de3b9cde977a70 (patch) | |
tree | 5e02ae0860af53e428c46fddc555b5b92ff6695f | |
parent | 121372d89662a674a3ae4fdc5ad6ff1a0db3cf30 (diff) |
of/platform: Move platform devices under /sys/devices/platform
Currently the devices created by drivers/of/platform.c get created at
the root of /sys/devices. This goes against the typical pattern for
sysfs where the top level /sys/devices structure contains categories of
devices, and the structure of devices is placed below that. To fix this,
make the code in drivers/of/platform.c follow the drivers/base/platform.c
behaviour, and use &platform_bus as the default parent for all new
platform_devices and amba_devices.
This change has been discussed for a long time, but nobody has actually
acted on it. Userspace code that expects to find devices under a fixed
/sys/devices/... path will be affected. It isn't /supposed/ to do that,
but if anyone complains then I'll add a default-off workaround option to
put them back into the root.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
(cherry picked from commit 43c0767e17ac70e494b6a381b3a20be6a1a75c70)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/platform.c
-rw-r--r-- | drivers/of/platform.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 404d1daebefa..5b0f1b08f2be 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -172,10 +172,7 @@ struct platform_device *of_device_alloc(struct device_node *np, } dev->dev.of_node = of_node_get(np); -#if defined(CONFIG_MICROBLAZE) - dev->dev.dma_mask = &dev->archdata.dma_mask; -#endif - dev->dev.parent = parent; + dev->dev.parent = parent ? : &platform_bus; if (bus_id) dev_set_name(&dev->dev, "%s", bus_id); @@ -275,7 +272,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, /* setup generic device info */ dev->dev.coherent_dma_mask = ~0; dev->dev.of_node = of_node_get(node); - dev->dev.parent = parent; + dev->dev.parent = parent ? : &platform_bus; dev->dev.platform_data = platform_data; if (bus_id) dev_set_name(&dev->dev, "%s", bus_id); |