summaryrefslogtreecommitdiff
path: root/include/linux/of_platform.h
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2014-06-24 19:13:47 +0400
committerGrant Likely <grant.likely@linaro.org>2014-07-07 16:33:46 +0400
commit75f353b61342b5847c7f6d8499fd6301dce09845 (patch)
tree39181c9145ae4a6625128a9b81ebbac2011429eb /include/linux/of_platform.h
parentcd3de83f147601356395b57a8673e9c5ff1e59d1 (diff)
downloadlinux-75f353b61342b5847c7f6d8499fd6301dce09845.tar.xz
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>
Diffstat (limited to 'include/linux/of_platform.h')
-rw-r--r--include/linux/of_platform.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index d96e1badbee0..c2b0627a2317 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -72,7 +72,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);
#else
static inline int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
@@ -81,10 +81,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 */