aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/of/device.c2
-rw-r--r--include/asm-powerpc/of_device.h22
-rw-r--r--include/asm-sparc/of_device.h15
-rw-r--r--include/asm-sparc64/of_device.h15
-rw-r--r--include/linux/of_device.h26
5 files changed, 40 insertions, 40 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 7f233d77d62f..6245f060fb77 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -1,13 +1,13 @@
1#include <linux/string.h> 1#include <linux/string.h>
2#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <linux/of.h> 3#include <linux/of.h>
4#include <linux/of_device.h>
4#include <linux/init.h> 5#include <linux/init.h>
5#include <linux/module.h> 6#include <linux/module.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
7#include <linux/slab.h> 8#include <linux/slab.h>
8 9
9#include <asm/errno.h> 10#include <asm/errno.h>
10#include <asm/of_device.h>
11 11
12/** 12/**
13 * of_match_node - Tell if an device_node has a matching of_match structure 13 * of_match_node - Tell if an device_node has a matching of_match structure
diff --git a/include/asm-powerpc/of_device.h b/include/asm-powerpc/of_device.h
index e9af49eb1aa8..ec2a8a2c737c 100644
--- a/include/asm-powerpc/of_device.h
+++ b/include/asm-powerpc/of_device.h
@@ -3,14 +3,12 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/mod_devicetable.h> 6#include <linux/of.h>
7#include <asm/prom.h>
8
9 7
10/* 8/*
11 * The of_device is a kind of "base class" that is a superset of 9 * The of_device is a kind of "base class" that is a superset of
12 * struct device for use by devices attached to an OF node and 10 * struct device for use by devices attached to an OF node and
13 * probed using OF properties 11 * probed using OF properties.
14 */ 12 */
15struct of_device 13struct of_device
16{ 14{
@@ -18,24 +16,14 @@ struct of_device
18 u64 dma_mask; /* DMA mask */ 16 u64 dma_mask; /* DMA mask */
19 struct device dev; /* Generic device interface */ 17 struct device dev; /* Generic device interface */
20}; 18};
21#define to_of_device(d) container_of(d, struct of_device, dev)
22
23extern const struct of_device_id *of_match_node(
24 const struct of_device_id *matches, const struct device_node *node);
25extern const struct of_device_id *of_match_device(
26 const struct of_device_id *matches, const struct of_device *dev);
27
28extern struct of_device *of_dev_get(struct of_device *dev);
29extern void of_dev_put(struct of_device *dev);
30
31extern int of_device_register(struct of_device *ofdev);
32extern void of_device_unregister(struct of_device *ofdev);
33extern void of_release_dev(struct device *dev);
34 19
35extern ssize_t of_device_get_modalias(struct of_device *ofdev, 20extern ssize_t of_device_get_modalias(struct of_device *ofdev,
36 char *str, ssize_t len); 21 char *str, ssize_t len);
37extern int of_device_uevent(struct device *dev, 22extern int of_device_uevent(struct device *dev,
38 char **envp, int num_envp, char *buffer, int buffer_size); 23 char **envp, int num_envp, char *buffer, int buffer_size);
39 24
25/* This is just here during the transition */
26#include <linux/of_device.h>
27
40#endif /* __KERNEL__ */ 28#endif /* __KERNEL__ */
41#endif /* _ASM_POWERPC_OF_DEVICE_H */ 29#endif /* _ASM_POWERPC_OF_DEVICE_H */
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h
index 7cb00c1b09c6..b625261c9ec7 100644
--- a/include/asm-sparc/of_device.h
+++ b/include/asm-sparc/of_device.h
@@ -3,9 +3,9 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
7#include <asm/openprom.h> 8#include <asm/openprom.h>
8#include <asm/prom.h>
9 9
10extern struct bus_type ebus_bus_type; 10extern struct bus_type ebus_bus_type;
11extern struct bus_type sbus_bus_type; 11extern struct bus_type sbus_bus_type;
@@ -30,19 +30,12 @@ struct of_device
30 int portid; 30 int portid;
31 int clock_freq; 31 int clock_freq;
32}; 32};
33#define to_of_device(d) container_of(d, struct of_device, dev)
34 33
35extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 34extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
36extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 35extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
37 36
38extern struct of_device *of_find_device_by_node(struct device_node *); 37extern struct of_device *of_find_device_by_node(struct device_node *);
39 38
40extern const struct of_device_id *of_match_device(
41 const struct of_device_id *matches, const struct of_device *dev);
42
43extern struct of_device *of_dev_get(struct of_device *dev);
44extern void of_dev_put(struct of_device *dev);
45
46/* 39/*
47 * An of_platform_driver driver is attached to a basic of_device on 40 * An of_platform_driver driver is attached to a basic of_device on
48 * the ISA, EBUS, and SBUS busses on sparc64. 41 * the ISA, EBUS, and SBUS busses on sparc64.
@@ -67,13 +60,13 @@ struct of_platform_driver
67extern int of_register_driver(struct of_platform_driver *drv, 60extern int of_register_driver(struct of_platform_driver *drv,
68 struct bus_type *bus); 61 struct bus_type *bus);
69extern void of_unregister_driver(struct of_platform_driver *drv); 62extern void of_unregister_driver(struct of_platform_driver *drv);
70extern int of_device_register(struct of_device *ofdev);
71extern void of_device_unregister(struct of_device *ofdev);
72extern struct of_device *of_platform_device_create(struct device_node *np, 63extern struct of_device *of_platform_device_create(struct device_node *np,
73 const char *bus_id, 64 const char *bus_id,
74 struct device *parent, 65 struct device *parent,
75 struct bus_type *bus); 66 struct bus_type *bus);
76extern void of_release_dev(struct device *dev); 67
68/* This is just here during the transition */
69#include <linux/of_device.h>
77 70
78#endif /* __KERNEL__ */ 71#endif /* __KERNEL__ */
79#endif /* _ASM_SPARC_OF_DEVICE_H */ 72#endif /* _ASM_SPARC_OF_DEVICE_H */
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h
index 60e9173c9acb..68048cb20688 100644
--- a/include/asm-sparc64/of_device.h
+++ b/include/asm-sparc64/of_device.h
@@ -3,9 +3,9 @@
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
7#include <asm/openprom.h> 8#include <asm/openprom.h>
8#include <asm/prom.h>
9 9
10extern struct bus_type isa_bus_type; 10extern struct bus_type isa_bus_type;
11extern struct bus_type ebus_bus_type; 11extern struct bus_type ebus_bus_type;
@@ -31,19 +31,12 @@ struct of_device
31 int portid; 31 int portid;
32 int clock_freq; 32 int clock_freq;
33}; 33};
34#define to_of_device(d) container_of(d, struct of_device, dev)
35 34
36extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 35extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
37extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 36extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size);
38 37
39extern struct of_device *of_find_device_by_node(struct device_node *); 38extern struct of_device *of_find_device_by_node(struct device_node *);
40 39
41extern const struct of_device_id *of_match_device(
42 const struct of_device_id *matches, const struct of_device *dev);
43
44extern struct of_device *of_dev_get(struct of_device *dev);
45extern void of_dev_put(struct of_device *dev);
46
47/* 40/*
48 * An of_platform_driver driver is attached to a basic of_device on 41 * An of_platform_driver driver is attached to a basic of_device on
49 * the ISA, EBUS, and SBUS busses on sparc64. 42 * the ISA, EBUS, and SBUS busses on sparc64.
@@ -68,13 +61,13 @@ struct of_platform_driver
68extern int of_register_driver(struct of_platform_driver *drv, 61extern int of_register_driver(struct of_platform_driver *drv,
69 struct bus_type *bus); 62 struct bus_type *bus);
70extern void of_unregister_driver(struct of_platform_driver *drv); 63extern void of_unregister_driver(struct of_platform_driver *drv);
71extern int of_device_register(struct of_device *ofdev);
72extern void of_device_unregister(struct of_device *ofdev);
73extern struct of_device *of_platform_device_create(struct device_node *np, 64extern struct of_device *of_platform_device_create(struct device_node *np,
74 const char *bus_id, 65 const char *bus_id,
75 struct device *parent, 66 struct device *parent,
76 struct bus_type *bus); 67 struct bus_type *bus);
77extern void of_release_dev(struct device *dev); 68
69/* This is just here during the transition */
70#include <linux/of_device.h>
78 71
79#endif /* __KERNEL__ */ 72#endif /* __KERNEL__ */
80#endif /* _ASM_SPARC64_OF_DEVICE_H */ 73#endif /* _ASM_SPARC64_OF_DEVICE_H */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
new file mode 100644
index 000000000000..91bf84b9d144
--- /dev/null
+++ b/include/linux/of_device.h
@@ -0,0 +1,26 @@
1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H
3#ifdef __KERNEL__
4
5#include <linux/device.h>
6#include <linux/of.h>
7#include <linux/mod_devicetable.h>
8
9#include <asm/of_device.h>
10
11#define to_of_device(d) container_of(d, struct of_device, dev)
12
13extern const struct of_device_id *of_match_node(
14 const struct of_device_id *matches, const struct device_node *node);
15extern const struct of_device_id *of_match_device(
16 const struct of_device_id *matches, const struct of_device *dev);
17
18extern struct of_device *of_dev_get(struct of_device *dev);
19extern void of_dev_put(struct of_device *dev);
20
21extern int of_device_register(struct of_device *ofdev);
22extern void of_device_unregister(struct of_device *ofdev);
23extern void of_release_dev(struct device *dev);
24
25#endif /* __KERNEL__ */
26#endif /* _LINUX_OF_DEVICE_H */