Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Begin consolidation of of_device.h

This just moves the common stuff from the arch of_device.h files to
linux/of_device.h.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Acked-by: David S. Miller <davem@davemloft.net>

+40 -40
+1 -1
drivers/of/device.c
··· 1 1 #include <linux/string.h> 2 2 #include <linux/kernel.h> 3 3 #include <linux/of.h> 4 + #include <linux/of_device.h> 4 5 #include <linux/init.h> 5 6 #include <linux/module.h> 6 7 #include <linux/mod_devicetable.h> 7 8 #include <linux/slab.h> 8 9 9 10 #include <asm/errno.h> 10 - #include <asm/of_device.h> 11 11 12 12 /** 13 13 * of_match_node - Tell if an device_node has a matching of_match structure
+5 -17
include/asm-powerpc/of_device.h
··· 3 3 #ifdef __KERNEL__ 4 4 5 5 #include <linux/device.h> 6 - #include <linux/mod_devicetable.h> 7 - #include <asm/prom.h> 8 - 6 + #include <linux/of.h> 9 7 10 8 /* 11 9 * The of_device is a kind of "base class" that is a superset of 12 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 */ 15 13 struct of_device 16 14 { ··· 16 18 u64 dma_mask; /* DMA mask */ 17 19 struct device dev; /* Generic device interface */ 18 20 }; 19 - #define to_of_device(d) container_of(d, struct of_device, dev) 20 - 21 - extern const struct of_device_id *of_match_node( 22 - const struct of_device_id *matches, const struct device_node *node); 23 - extern const struct of_device_id *of_match_device( 24 - const struct of_device_id *matches, const struct of_device *dev); 25 - 26 - extern struct of_device *of_dev_get(struct of_device *dev); 27 - extern void of_dev_put(struct of_device *dev); 28 - 29 - extern int of_device_register(struct of_device *ofdev); 30 - extern void of_device_unregister(struct of_device *ofdev); 31 - extern void of_release_dev(struct device *dev); 32 21 33 22 extern ssize_t of_device_get_modalias(struct of_device *ofdev, 34 23 char *str, ssize_t len); 35 24 extern int of_device_uevent(struct device *dev, 36 25 char **envp, int num_envp, char *buffer, int buffer_size); 26 + 27 + /* This is just here during the transition */ 28 + #include <linux/of_device.h> 37 29 38 30 #endif /* __KERNEL__ */ 39 31 #endif /* _ASM_POWERPC_OF_DEVICE_H */
+4 -11
include/asm-sparc/of_device.h
··· 3 3 #ifdef __KERNEL__ 4 4 5 5 #include <linux/device.h> 6 + #include <linux/of.h> 6 7 #include <linux/mod_devicetable.h> 7 8 #include <asm/openprom.h> 8 - #include <asm/prom.h> 9 9 10 10 extern struct bus_type ebus_bus_type; 11 11 extern struct bus_type sbus_bus_type; ··· 30 30 int portid; 31 31 int clock_freq; 32 32 }; 33 - #define to_of_device(d) container_of(d, struct of_device, dev) 34 33 35 34 extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 36 35 extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 37 36 38 37 extern struct of_device *of_find_device_by_node(struct device_node *); 39 - 40 - extern const struct of_device_id *of_match_device( 41 - const struct of_device_id *matches, const struct of_device *dev); 42 - 43 - extern struct of_device *of_dev_get(struct of_device *dev); 44 - extern void of_dev_put(struct of_device *dev); 45 38 46 39 /* 47 40 * An of_platform_driver driver is attached to a basic of_device on ··· 60 67 extern int of_register_driver(struct of_platform_driver *drv, 61 68 struct bus_type *bus); 62 69 extern void of_unregister_driver(struct of_platform_driver *drv); 63 - extern int of_device_register(struct of_device *ofdev); 64 - extern void of_device_unregister(struct of_device *ofdev); 65 70 extern struct of_device *of_platform_device_create(struct device_node *np, 66 71 const char *bus_id, 67 72 struct device *parent, 68 73 struct bus_type *bus); 69 - extern void of_release_dev(struct device *dev); 74 + 75 + /* This is just here during the transition */ 76 + #include <linux/of_device.h> 70 77 71 78 #endif /* __KERNEL__ */ 72 79 #endif /* _ASM_SPARC_OF_DEVICE_H */
+4 -11
include/asm-sparc64/of_device.h
··· 3 3 #ifdef __KERNEL__ 4 4 5 5 #include <linux/device.h> 6 + #include <linux/of.h> 6 7 #include <linux/mod_devicetable.h> 7 8 #include <asm/openprom.h> 8 - #include <asm/prom.h> 9 9 10 10 extern struct bus_type isa_bus_type; 11 11 extern struct bus_type ebus_bus_type; ··· 31 31 int portid; 32 32 int clock_freq; 33 33 }; 34 - #define to_of_device(d) container_of(d, struct of_device, dev) 35 34 36 35 extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 37 36 extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 38 37 39 38 extern struct of_device *of_find_device_by_node(struct device_node *); 40 - 41 - extern const struct of_device_id *of_match_device( 42 - const struct of_device_id *matches, const struct of_device *dev); 43 - 44 - extern struct of_device *of_dev_get(struct of_device *dev); 45 - extern void of_dev_put(struct of_device *dev); 46 39 47 40 /* 48 41 * An of_platform_driver driver is attached to a basic of_device on ··· 61 68 extern int of_register_driver(struct of_platform_driver *drv, 62 69 struct bus_type *bus); 63 70 extern void of_unregister_driver(struct of_platform_driver *drv); 64 - extern int of_device_register(struct of_device *ofdev); 65 - extern void of_device_unregister(struct of_device *ofdev); 66 71 extern struct of_device *of_platform_device_create(struct device_node *np, 67 72 const char *bus_id, 68 73 struct device *parent, 69 74 struct bus_type *bus); 70 - extern void of_release_dev(struct device *dev); 75 + 76 + /* This is just here during the transition */ 77 + #include <linux/of_device.h> 71 78 72 79 #endif /* __KERNEL__ */ 73 80 #endif /* _ASM_SPARC64_OF_DEVICE_H */
+26
include/linux/of_device.h
··· 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 + 13 + extern const struct of_device_id *of_match_node( 14 + const struct of_device_id *matches, const struct device_node *node); 15 + extern const struct of_device_id *of_match_device( 16 + const struct of_device_id *matches, const struct of_device *dev); 17 + 18 + extern struct of_device *of_dev_get(struct of_device *dev); 19 + extern void of_dev_put(struct of_device *dev); 20 + 21 + extern int of_device_register(struct of_device *ofdev); 22 + extern void of_device_unregister(struct of_device *ofdev); 23 + extern void of_release_dev(struct device *dev); 24 + 25 + #endif /* __KERNEL__ */ 26 + #endif /* _LINUX_OF_DEVICE_H */