Skip to content

Commit cb8be8b

Browse files
committed
driver core: platform: Drop of_device_node_put() wrapper
of_device_node_put() is just a wrapper for of_node_put(). The platform driver core is already polluted with of_node pointers and the only 'get' already uses of_node_get() (though typically the get would happen in of_device_alloc()). Cc: "Rafael J. Wysocki" <[email protected]> Cc: Frank Rowand <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 83c4a4e commit cb8be8b

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

drivers/base/platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ static void platform_device_release(struct device *dev)
571571
struct platform_object *pa = container_of(dev, struct platform_object,
572572
pdev.dev);
573573

574-
of_device_node_put(&pa->pdev.dev);
574+
of_node_put(pa->pdev.dev.of_node);
575575
kfree(pa->pdev.dev.platform_data);
576576
kfree(pa->pdev.mfd_cell);
577577
kfree(pa->pdev.resource);

include/linux/of_device.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ extern int of_device_request_module(struct device *dev);
3838
extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
3939
extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env);
4040

41-
static inline void of_device_node_put(struct device *dev)
42-
{
43-
of_node_put(dev->of_node);
44-
}
45-
4641
static inline struct device_node *of_cpu_device_node_get(int cpu)
4742
{
4843
struct device *cpu_dev;
@@ -94,8 +89,6 @@ static inline int of_device_uevent_modalias(struct device *dev,
9489
return -ENODEV;
9590
}
9691

97-
static inline void of_device_node_put(struct device *dev) { }
98-
9992
static inline const struct of_device_id *of_match_device(
10093
const struct of_device_id *matches, const struct device *dev)
10194
{

0 commit comments

Comments
 (0)