提交 526b5b3e 编写于 作者: G Grant Likely

of: merge of_node_get(), of_node_put() and of_find_all_nodes()

Merge common code between Sparc, PowerPC and Microblaze.

Sparc differs in the implementation at this point, so this patch uses
a #ifdef to handle sparc differently for now.  The merging of
implementations will occur in a later patch
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Acked-by: NWolfram Sang <w.sang@pengutronix.de>
Acked-by: NMichal Simek <monstr@monstr.eu>
Acked-by: NStephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: NStephen Rothwell <sfr@canb.auug.org.au>
上级 b6caf2ad
...@@ -40,10 +40,6 @@ extern struct device_node *of_chosen; ...@@ -40,10 +40,6 @@ extern struct device_node *of_chosen;
extern struct device_node *allnodes; /* temporary while merging */ extern struct device_node *allnodes; /* temporary while merging */
extern rwlock_t devtree_lock; /* temporary while merging */ extern rwlock_t devtree_lock; /* temporary while merging */
extern struct device_node *of_find_all_nodes(struct device_node *prev);
extern struct device_node *of_node_get(struct device_node *node);
extern void of_node_put(struct device_node *node);
/* For scanning the flat device-tree at boot time */ /* For scanning the flat device-tree at boot time */
extern int __init of_scan_flat_dt(int (*it)(unsigned long node, extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
const char *uname, int depth, const char *uname, int depth,
......
...@@ -34,10 +34,6 @@ extern struct device_node *of_chosen; ...@@ -34,10 +34,6 @@ extern struct device_node *of_chosen;
#define HAVE_ARCH_DEVTREE_FIXUPS #define HAVE_ARCH_DEVTREE_FIXUPS
extern struct device_node *of_find_all_nodes(struct device_node *prev);
extern struct device_node *of_node_get(struct device_node *node);
extern void of_node_put(struct device_node *node);
/* For scanning the flat device-tree at boot time */ /* For scanning the flat device-tree at boot time */
extern int __init of_scan_flat_dt(int (*it)(unsigned long node, extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
const char *uname, int depth, const char *uname, int depth,
......
...@@ -51,15 +51,6 @@ extern void prom_build_devicetree(void); ...@@ -51,15 +51,6 @@ extern void prom_build_devicetree(void);
extern void of_populate_present_mask(void); extern void of_populate_present_mask(void);
extern void of_fill_in_cpu_data(void); extern void of_fill_in_cpu_data(void);
/* Dummy ref counting routines - to be implemented later */
static inline struct device_node *of_node_get(struct device_node *node)
{
return node;
}
static inline void of_node_put(struct device_node *node)
{
}
/* These routines are here to provide compatibility with how powerpc /* These routines are here to provide compatibility with how powerpc
* handles IRQ mapping for OF device nodes. We precompute and permanently * handles IRQ mapping for OF device nodes. We precompute and permanently
* register them in the of_device objects, whereas powerpc computes them * register them in the of_device objects, whereas powerpc computes them
......
...@@ -79,6 +79,22 @@ set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) ...@@ -79,6 +79,22 @@ set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
dn->pde = de; dn->pde = de;
} }
#if defined(CONFIG_SPARC)
/* Dummy ref counting routines - to be implemented later */
static inline struct device_node *of_node_get(struct device_node *node)
{
return node;
}
static inline void of_node_put(struct device_node *node)
{
}
#else
extern struct device_node *of_find_all_nodes(struct device_node *prev);
extern struct device_node *of_node_get(struct device_node *node);
extern void of_node_put(struct device_node *node);
#endif
/* /*
* OF address retreival & translation * OF address retreival & translation
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册