aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2014-06-24 16:13:47 +0100
committerMark Brown <broonie@kernel.org>2015-02-17 01:12:53 +0900
commitf2d2cdb9c3bfe92ac575a540b4b3b04313485caa (patch)
tree6576e980556184872fa942df7a9b6af34825353d /include
parente0bc89c5e7542c36e90d74070ca6af79ff3ec0cf (diff)
of/platform: Fix of_platform_device_destroy iteration of devices
of_platform_destroy does not work properly, since the tree population test was iterating on all devices having as its parent the given platform device. The check was intended to check whether any other platform or amba devices created by of_platform_populate were still populated, but instead checked for every kind of device. This is wrong, since platform devices typically create a subsystem regular device and set themselves as parents. Instead, go ahead and call the unregister functions for any devices created with of_platform_populate. The driver core will take care of unbinding drivers, and drivers are responsible for getting rid of any child devices that weren't created by of_platform_populate. Signed-off-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> (cherry picked from commit 75f353b61342b5847c7f6d8499fd6301dce09845) Signed-off-by: Mark Brown <broonie@kernel.org> Conflicts: include/linux/of_platform.h
Diffstat (limited to 'include')
-rw-r--r--include/linux/of.h1
-rw-r--r--include/linux/of_platform.h7
2 files changed, 3 insertions, 5 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 9755b7a470aa..f270a2041f29 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -206,6 +206,7 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
#define OF_DETACHED 2 /* node has been detached from the device tree */
#define OF_POPULATED 3 /* device already created for the node */
+#define OF_POPULATED_BUS 4 /* of_platform_populate recursed to children of this node */
#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index d7ecf5346278..3e989ed04e3f 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -95,7 +95,7 @@ extern int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
const struct of_dev_auxdata *lookup,
struct device *parent);
-extern int of_platform_depopulate(struct device *parent);
+extern void of_platform_depopulate(struct device *parent);
#endif /* CONFIG_OF_ADDRESS */
#endif /* CONFIG_OF_DEVICE */
@@ -110,10 +110,7 @@ static inline int of_platform_populate(struct device_node *root,
{
return -ENODEV;
}
-static inline int of_platform_depopulate(struct device *parent)
-{
- return -ENODEV;
-}
+static inline void of_platform_depopulate(struct device *parent) { }
#endif
#endif /* _LINUX_OF_PLATFORM_H */