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

Create linux/of_platorm.h

Move common stuff from asm-powerpc/of_platform.h to here and
move the common bits from asm-sparc*/of_device.h here as well.

Create asm-sparc*/of_platform.h and move appropriate parts of
of_device.h to them.

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>

+130 -107
+6 -32
include/asm-powerpc/of_platform.h
··· 1 + #ifndef _ASM_POWERPC_OF_PLATFORM_H 2 + #define _ASM_POWERPC_OF_PLATFORM_H 1 3 /* 2 4 * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. 3 5 * <benh@kernel.crashing.org> ··· 11 9 * 12 10 */ 13 11 14 - #include <asm/of_device.h> 15 - 16 - /* 17 - * The of_platform_bus_type is a bus type used by drivers that do not 18 - * attach to a macio or similar bus but still use OF probing 19 - * mechanism 20 - */ 21 - extern struct bus_type of_platform_bus_type; 22 - 23 - /* 24 - * An of_platform_driver driver is attached to a basic of_device on 25 - * the "platform bus" (of_platform_bus_type) 26 - */ 27 - struct of_platform_driver 28 - { 29 - char *name; 30 - struct of_device_id *match_table; 31 - struct module *owner; 32 - 33 - int (*probe)(struct of_device* dev, 34 - const struct of_device_id *match); 35 - int (*remove)(struct of_device* dev); 36 - 37 - int (*suspend)(struct of_device* dev, pm_message_t state); 38 - int (*resume)(struct of_device* dev); 39 - int (*shutdown)(struct of_device* dev); 40 - 41 - struct device_driver driver; 42 - }; 43 - #define to_of_platform_driver(drv) \ 44 - container_of(drv,struct of_platform_driver, driver) 12 + /* This is just here during the transition */ 13 + #include <linux/of_platform.h> 45 14 46 15 /* Platform drivers register/unregister */ 47 16 extern int of_register_platform_driver(struct of_platform_driver *drv); ··· 29 56 struct of_device_id *matches, 30 57 struct device *parent); 31 58 32 - extern struct of_device *of_find_device_by_node(struct device_node *np); 33 59 extern struct of_device *of_find_device_by_phandle(phandle ph); 60 + 61 + #endif /* _ASM_POWERPC_OF_PLATFORM_H */
+2 -37
include/asm-sparc/of_device.h
··· 7 7 #include <linux/mod_devicetable.h> 8 8 #include <asm/openprom.h> 9 9 10 - extern struct bus_type ebus_bus_type; 11 - extern struct bus_type sbus_bus_type; 12 - extern struct bus_type of_platform_bus_type; 13 - #define of_bus_type of_platform_bus_type /* for compatibility */ 14 - 15 10 /* 16 11 * The of_device is a kind of "base class" that is a superset of 17 12 * struct device for use by devices attached to an OF node and ··· 30 35 extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 31 36 extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 32 37 33 - extern struct of_device *of_find_device_by_node(struct device_node *); 34 - 35 - /* 36 - * An of_platform_driver driver is attached to a basic of_device on 37 - * the ISA, EBUS, and SBUS busses on sparc64. 38 - */ 39 - struct of_platform_driver 40 - { 41 - char *name; 42 - struct of_device_id *match_table; 43 - struct module *owner; 44 - 45 - int (*probe)(struct of_device* dev, const struct of_device_id *match); 46 - int (*remove)(struct of_device* dev); 47 - 48 - int (*suspend)(struct of_device* dev, pm_message_t state); 49 - int (*resume)(struct of_device* dev); 50 - int (*shutdown)(struct of_device* dev); 51 - 52 - struct device_driver driver; 53 - }; 54 - #define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver) 55 - 56 - extern int of_register_driver(struct of_platform_driver *drv, 57 - struct bus_type *bus); 58 - extern void of_unregister_driver(struct of_platform_driver *drv); 59 - extern struct of_device *of_platform_device_create(struct device_node *np, 60 - const char *bus_id, 61 - struct device *parent, 62 - struct bus_type *bus); 63 - 64 - /* This is just here during the transition */ 38 + /* These are just here during the transition */ 65 39 #include <linux/of_device.h> 40 + #include <linux/of_platform.h> 66 41 67 42 #endif /* __KERNEL__ */ 68 43 #endif /* _ASM_SPARC_OF_DEVICE_H */
+32
include/asm-sparc/of_platform.h
··· 1 + #ifndef _ASM_SPARC_OF_PLATFORM_H 2 + #define _ASM_SPARC_OF_PLATFORM_H 3 + /* 4 + * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. 5 + * <benh@kernel.crashing.org> 6 + * Modified for Sparc by merging parts of asm-sparc/of_device.h 7 + * by Stephen Rothwell 8 + * 9 + * This program is free software; you can redistribute it and/or 10 + * modify it under the terms of the GNU General Public License 11 + * as published by the Free Software Foundation; either version 12 + * 2 of the License, or (at your option) any later version. 13 + * 14 + */ 15 + 16 + /* This is just here during the transition */ 17 + #include <linux/of_platform.h> 18 + 19 + extern struct bus_type ebus_bus_type; 20 + extern struct bus_type sbus_bus_type; 21 + extern struct bus_type of_platform_bus_type; 22 + #define of_bus_type of_platform_bus_type /* for compatibility */ 23 + 24 + extern int of_register_driver(struct of_platform_driver *drv, 25 + struct bus_type *bus); 26 + extern void of_unregister_driver(struct of_platform_driver *drv); 27 + extern struct of_device *of_platform_device_create(struct device_node *np, 28 + const char *bus_id, 29 + struct device *parent, 30 + struct bus_type *bus); 31 + 32 + #endif /* _ASM_SPARC_OF_PLATFORM_H */
+2 -38
include/asm-sparc64/of_device.h
··· 7 7 #include <linux/mod_devicetable.h> 8 8 #include <asm/openprom.h> 9 9 10 - extern struct bus_type isa_bus_type; 11 - extern struct bus_type ebus_bus_type; 12 - extern struct bus_type sbus_bus_type; 13 - extern struct bus_type of_platform_bus_type; 14 - #define of_bus_type of_platform_bus_type /* for compatibility */ 15 - 16 10 /* 17 11 * The of_device is a kind of "base class" that is a superset of 18 12 * struct device for use by devices attached to an OF node and ··· 30 36 extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name); 31 37 extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long size); 32 38 33 - extern struct of_device *of_find_device_by_node(struct device_node *); 34 - 35 - /* 36 - * An of_platform_driver driver is attached to a basic of_device on 37 - * the ISA, EBUS, and SBUS busses on sparc64. 38 - */ 39 - struct of_platform_driver 40 - { 41 - char *name; 42 - struct of_device_id *match_table; 43 - struct module *owner; 44 - 45 - int (*probe)(struct of_device* dev, const struct of_device_id *match); 46 - int (*remove)(struct of_device* dev); 47 - 48 - int (*suspend)(struct of_device* dev, pm_message_t state); 49 - int (*resume)(struct of_device* dev); 50 - int (*shutdown)(struct of_device* dev); 51 - 52 - struct device_driver driver; 53 - }; 54 - #define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver) 55 - 56 - extern int of_register_driver(struct of_platform_driver *drv, 57 - struct bus_type *bus); 58 - extern void of_unregister_driver(struct of_platform_driver *drv); 59 - extern struct of_device *of_platform_device_create(struct device_node *np, 60 - const char *bus_id, 61 - struct device *parent, 62 - struct bus_type *bus); 63 - 64 - /* This is just here during the transition */ 39 + /* These are just here during the transition */ 65 40 #include <linux/of_device.h> 41 + #include <linux/of_platform.h> 66 42 67 43 #endif /* __KERNEL__ */ 68 44 #endif /* _ASM_SPARC64_OF_DEVICE_H */
+33
include/asm-sparc64/of_platform.h
··· 1 + #ifndef _ASM_SPARC64_OF_PLATFORM_H 2 + #define _ASM_SPARC64_OF_PLATFORM_H 3 + /* 4 + * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. 5 + * <benh@kernel.crashing.org> 6 + * Modified for Sparc by merging parts of asm-sparc/of_device.h 7 + * by Stephen Rothwell 8 + * 9 + * This program is free software; you can redistribute it and/or 10 + * modify it under the terms of the GNU General Public License 11 + * as published by the Free Software Foundation; either version 12 + * 2 of the License, or (at your option) any later version. 13 + * 14 + */ 15 + 16 + /* This is just here during the transition */ 17 + #include <linux/of_platform.h> 18 + 19 + extern struct bus_type isa_bus_type; 20 + extern struct bus_type ebus_bus_type; 21 + extern struct bus_type sbus_bus_type; 22 + extern struct bus_type of_platform_bus_type; 23 + #define of_bus_type of_platform_bus_type /* for compatibility */ 24 + 25 + extern int of_register_driver(struct of_platform_driver *drv, 26 + struct bus_type *bus); 27 + extern void of_unregister_driver(struct of_platform_driver *drv); 28 + extern struct of_device *of_platform_device_create(struct device_node *np, 29 + const char *bus_id, 30 + struct device *parent, 31 + struct bus_type *bus); 32 + 33 + #endif /* _ASM_SPARC64_OF_PLATFORM_H */
+55
include/linux/of_platform.h
··· 1 + #ifndef _LINUX_OF_PLATFORM_H 2 + #define _LINUX_OF_PLATFORM_H 3 + /* 4 + * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. 5 + * <benh@kernel.crashing.org> 6 + * 7 + * This program is free software; you can redistribute it and/or 8 + * modify it under the terms of the GNU General Public License 9 + * as published by the Free Software Foundation; either version 10 + * 2 of the License, or (at your option) any later version. 11 + * 12 + */ 13 + 14 + #include <linux/module.h> 15 + #include <linux/device.h> 16 + #include <linux/mod_devicetable.h> 17 + #include <linux/pm.h> 18 + #include <linux/of_device.h> 19 + 20 + /* 21 + * The of_platform_bus_type is a bus type used by drivers that do not 22 + * attach to a macio or similar bus but still use OF probing 23 + * mechanism 24 + */ 25 + extern struct bus_type of_platform_bus_type; 26 + 27 + /* 28 + * An of_platform_driver driver is attached to a basic of_device on 29 + * the "platform bus" (of_platform_bus_type) (or ISA, EBUS and SBUS 30 + * busses on sparc). 31 + */ 32 + struct of_platform_driver 33 + { 34 + char *name; 35 + struct of_device_id *match_table; 36 + struct module *owner; 37 + 38 + int (*probe)(struct of_device* dev, 39 + const struct of_device_id *match); 40 + int (*remove)(struct of_device* dev); 41 + 42 + int (*suspend)(struct of_device* dev, pm_message_t state); 43 + int (*resume)(struct of_device* dev); 44 + int (*shutdown)(struct of_device* dev); 45 + 46 + struct device_driver driver; 47 + }; 48 + #define to_of_platform_driver(drv) \ 49 + container_of(drv,struct of_platform_driver, driver) 50 + 51 + #include <asm/of_platform.h> 52 + 53 + extern struct of_device *of_find_device_by_node(struct device_node *np); 54 + 55 + #endif /* _LINUX_OF_PLATFORM_H */