Skip to content

Commit 4c2bb57

Browse files
committed
of: move kobj_to_device_node() into dynamic.c
The only user of kobj_to_device_node() is in dynamic.c, so move it there. This avoids having to make it conditional once kobject is configurable. Tested-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Frank Rowand <frowand.list@gmail.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 16bba30 commit 4c2bb57

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎drivers/of/dynamic.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
#include "of_private.h"
1818

19+
static struct device_node *kobj_to_device_node(struct kobject *kobj)
20+
{
21+
return container_of(kobj, struct device_node, kobj);
22+
}
23+
1924
/**
2025
* of_node_get() - Increment refcount of a node
2126
* @node: Node to inc refcount, NULL is supported to simplify writing of

‎drivers/of/of_private.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ extern struct mutex of_mutex;
3535
extern struct list_head aliases_lookup;
3636
extern struct kset *of_kset;
3737

38-
39-
static inline struct device_node *kobj_to_device_node(struct kobject *kobj)
40-
{
41-
return container_of(kobj, struct device_node, kobj);
42-
}
43-
4438
#if defined(CONFIG_OF_DYNAMIC)
4539
extern int of_property_notify(int action, struct device_node *np,
4640
struct property *prop, struct property *old_prop);

0 commit comments

Comments
 (0)