Eliminate of_platform_bus_type
Subsystems (18)
cover Eliminate of_platform_bus_type
This series eliminates the OF platform bus type and moves all users over to the platform bus. There is still work to be done to remove the of_platform_driver references the affected drivers and then remove the transitional code, but with this series those changes can be done piecewise.
These changes have been tested on PowerPC and UltraSparc. Microblaze has only been compile tested (at least by me, but they've been in my test branch for a long time now, so Michal may have given them a spin.
This series depends on my next-devicetree[1] branch which is also in linux-next. I'm pushing them out to my experimental[2] branch for testing now, and I'll add them to next-devicetree next week unless I hear otherwise.
David, you'll also want to take a look at patches 4 & 5 to see if you agree with my decisions on where I move symbols in the header files.
Cheers,
g.
---
Grant Likely (5):
drivercore/of: Add OF style matching to platform bus
of: Merge of_platform_bus_type with platform_bus_type of/platform: remove all of_bus_type and of_platform_bus_type references
of: remove asm/of_platform.h
of: remove asm/of_device.h
arch/microblaze/include/asm/of_device.h | 13 ------ arch/microblaze/include/asm/of_platform.h | 19 -------- arch/microblaze/kernel/of_platform.c | 14 ------ arch/microblaze/kernel/setup.c | 6 --- arch/powerpc/include/asm/of_device.h | 3 - arch/powerpc/include/asm/of_platform.h | 16 ------- arch/powerpc/include/asm/prom.h | 2 + arch/powerpc/kernel/dma-swiotlb.c | 8 --- arch/powerpc/kernel/of_platform.c | 15 ------ arch/powerpc/kernel/setup-common.c | 7 --- arch/powerpc/platforms/cell/beat_iommu.c | 2 - arch/powerpc/platforms/cell/iommu.c | 2 - arch/powerpc/sysdev/mv64x60_dev.c | 7 --- arch/sparc/include/asm/device.h | 2 + arch/sparc/include/asm/of_device.h | 19 -------- arch/sparc/include/asm/of_platform.h | 18 -------- arch/sparc/include/asm/parport.h | 4 -- arch/sparc/include/asm/prom.h | 4 ++ arch/sparc/kernel/apc.c | 2 - arch/sparc/kernel/auxio_64.c | 2 - arch/sparc/kernel/central.c | 4 +- arch/sparc/kernel/chmc.c | 4 +- arch/sparc/kernel/of_device_32.c | 21 ++------- arch/sparc/kernel/of_device_64.c | 21 ++------- arch/sparc/kernel/of_device_common.c | 5 -- arch/sparc/kernel/pci_fire.c | 2 - arch/sparc/kernel/pci_psycho.c | 2 - arch/sparc/kernel/pci_sabre.c | 2 - arch/sparc/kernel/pci_schizo.c | 2 - arch/sparc/kernel/pci_sun4v.c | 2 - arch/sparc/kernel/pmc.c | 2 - arch/sparc/kernel/power.c | 2 - arch/sparc/kernel/time_32.c | 2 - arch/sparc/kernel/time_64.c | 6 +-- drivers/atm/fore200e.c | 6 +-- drivers/base/platform.c | 11 +++++ drivers/char/hw_random/n2-drv.c | 4 +- drivers/crypto/n2_core.c | 10 ++-- drivers/hwmon/ultra45_env.c | 4 +- drivers/input/misc/sparcspkr.c | 12 ++--- drivers/input/serio/i8042-sparcio.h | 5 +- drivers/mtd/maps/sun_uflash.c | 4 +- drivers/net/ibm_newemac/core.c | 4 +- drivers/net/myri_sbus.c | 4 +- drivers/net/niu.c | 6 +-- drivers/net/sunbmac.c | 4 +- drivers/net/sunhme.c | 4 +- drivers/net/sunlance.c | 4 +- drivers/net/sunqe.c | 4 +- drivers/of/device.c | 5 ++ drivers/of/platform.c | 67 ++++++++++++++++++++++++++++- drivers/parport/parport_sunbpp.c | 4 +- drivers/sbus/char/bbc_i2c.c | 4 +- drivers/sbus/char/display7seg.c | 4 +- drivers/sbus/char/envctrl.c | 4 +- drivers/sbus/char/flash.c | 4 +- drivers/sbus/char/uctrl.c | 4 +- drivers/scsi/qlogicpti.c | 4 +- drivers/scsi/sun_esp.c | 4 +- drivers/serial/sunhv.c | 4 +- drivers/serial/sunsab.c | 4 +- drivers/serial/sunsu.c | 2 - drivers/serial/sunzilog.c | 6 +-- drivers/video/bw2.c | 4 +- drivers/video/cg14.c | 4 +- drivers/video/cg3.c | 4 +- drivers/video/cg6.c | 4 +- drivers/video/ffb.c | 4 +- drivers/video/leo.c | 4 +- drivers/video/p9100.c | 4 +- drivers/video/sunxvr1000.c | 4 +- drivers/video/tcx.c | 4 +- drivers/watchdog/cpwd.c | 4 +- drivers/watchdog/riowd.c | 4 +- include/linux/of_device.h | 8 +++ include/linux/of_platform.h | 23 ++-------- sound/sparc/amd7930.c | 4 +- sound/sparc/cs4231.c | 4 +- sound/sparc/dbri.c | 4 +- 79 files changed, 222 insertions(+), 313 deletions(-) delete mode 100644 arch/microblaze/include/asm/of_device.h delete mode 100644 arch/microblaze/include/asm/of_platform.h delete mode 100644 arch/powerpc/include/asm/of_device.h delete mode 100644 arch/powerpc/include/asm/of_platform.h delete mode 100644 arch/sparc/include/asm/of_device.h delete mode 100644 arch/sparc/include/asm/of_platform.h
Signature · 1 line
Signature
PATCH 1/5 drivercore/of: Add OF style matching to platform bus
As part of the merge between platform bus and of_platform bus, add the ability to do of-style matching to the platform bus.
--- drivers/base/platform.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/base/platform.c +5 -0
@@ -12,6 +12,7 @@#include <linux/string.h> #include <linux/platform_device.h> +#include <linux/of_device.h> #include <linux/module.h> #include <linux/init.h> #include <linux/dma-mapping.h>
@@ -673,6 +674,10 @@ static int platform_match(struct device *dev, struct device_driver *drv)struct platform_device *pdev =to_platform_device (dev);struct platform_driver *pdrv =to_platform_driver (drv); +/* Attempt an OF style match first */ +if (of_driver_match_device (dev, drv)) +return 1 ; +/* match against the id table first */ if (pdrv->id_table)return platform_match_id (pdrv->id_table, pdev) !=NULL ;
Re: [PATCH 1/5] drivercore/of: Add OF style matching to platform bus
Quoted 30 lines · Grant Likely
As part of the merge between platform bus and
of_platformbus, add the ability to do of-style matching to the platform bus.Signed-off-by Grant Likely <[email protected]>CC Greg Kroah-Hartman <[email protected]>CC Michal Simek <[email protected]>CC Grant Likely <[email protected]>CC Benjamin Herrenschmidt <[email protected]>CC Stephen Rothwell <[email protected]>--- drivers/base/platform.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)drivers/base/platform.c +1
-0@@ -12,6 +12,7 @@#include <linux/string.h> #include <linux/platform_device.h> +#include <linux/of_device.h> #include <linux/module.h> #include <linux/init.h> #include <linux/dma-mapping.h>
drivers/base/platform.c static int platform_match(struct device *dev, struct device_driver *drv) · line 681
Quoted 8 lines
drivers/base/platform.c +4
-0@@ -673,6 +674,10 @@ static int platform_match(struct device *dev, struct device_driver *drv)struct platform_device *pdev =to_platform_device (dev);struct platform_driver *pdrv =to_platform_driver (drv); +/* Attempt an OF style match first */ +if (of_driver_match_device (dev, drv)) +return 1 ; +/* match against the id table first */
I think you need to also change this comment, you can't have two "firsts" :)
If you do that, feel free to add an:
to the patch.
thanks,
greg k-h
PATCH 2/5 of: Merge of_platform_bus_type with platform_bus_type
In reply to Grant Likelyof_platform_bus was being used in the same manner as the platform_bus. The only difference being that of_platform_bus devices are generated from data in the device tree, and platform_bus devices are usually statically allocated in platform code. Having them separate causes the problem of device drivers having to be registered twice if it was possible for the same device to appear on either bus.
This patch removes of_platform_bus_type and registers all of_platform bus devices and drivers on the platform bus instead. A previous patch made the of_device structure an alias for the platform_device structure, and a shim is used to adapt of_platform_drivers to the platform bus.
After all of of_platform_bus drivers are converted to be normal platform drivers, the shim code can be removed.
--- arch/microblaze/kernel/of_platform.c | 11 ----- arch/microblaze/kernel/setup.c | 6 --- arch/powerpc/kernel/dma-swiotlb.c | 8 ---- arch/powerpc/kernel/of_platform.c | 12 ----- arch/powerpc/kernel/setup-common.c | 7 --- arch/powerpc/platforms/cell/beat_iommu.c | 2 - arch/powerpc/platforms/cell/iommu.c | 2 - arch/powerpc/sysdev/mv64x60_dev.c | 7 --- arch/sparc/kernel/of_device_32.c | 21 ++------- arch/sparc/kernel/of_device_64.c | 21 ++------- arch/sparc/kernel/of_device_common.c | 3 - drivers/base/platform.c | 6 +++ drivers/of/device.c | 5 ++ drivers/of/platform.c | 67 +++++++++++++++++++++++++++++- include/linux/of_device.h | 6 +++ include/linux/of_platform.h | 21 ++++----- 16 files changed, 102 insertions(+), 103 deletions(-)
arch/microblaze/kernel/of_platform.c +0 -11
@@ -26,17 +26,6 @@#include <linux/topology.h> #include <asm/atomic.h> -struct bus_type of_platform_bus_type = { - .uevent = of_device_uevent, -}; -EXPORT_SYMBOL (of_platform_bus_type); - -static int __init of_bus_driver_init (void ) -{ -return of_bus_type_init (&of_platform_bus_type,"of_platform" ); -} -postcore_initcall (of_bus_driver_init); -/* * The list of OF IDs below is used for matching bus types in the * system whose devices are to be exposed as of_platform_devices.
arch/microblaze/kernel/setup.c +0 -6
@@ -213,15 +213,9 @@ static struct notifier_block dflt_plat_bus_notifier = { .priority = INT_MAX, }; -static struct notifier_block dflt_of_bus_notifier = { - .notifier_call = dflt_bus_notify, - .priority =INT_MAX , -}; -static int __init setup_bus_notifier (void ) {bus_register_notifier (&platform_bus_type, &dflt_plat_bus_notifier); -bus_register_notifier (&of_platform_bus_type, &dflt_of_bus_notifier);return 0 ; }
arch/powerpc/kernel/dma-swiotlb.c +0 -8
@@ -82,17 +82,9 @@ static struct notifier_block ppc_swiotlb_plat_bus_notifier = { .priority = 0, }; -static struct notifier_block ppc_swiotlb_of_bus_notifier = { - .notifier_call = ppc_swiotlb_bus_notify, - .priority =0 , -}; -int __init swiotlb_setup_bus_notifier (void ) {bus_register_notifier (&platform_bus_type, &ppc_swiotlb_plat_bus_notifier); -bus_register_notifier (&of_platform_bus_type, - &ppc_swiotlb_of_bus_notifier); -return 0 ; }
arch/powerpc/kernel/of_platform.c +0 -12
@@ -52,18 +52,6 @@ const struct of_device_id of_default_bus_ids[] = { {}, }; -struct bus_type of_platform_bus_type = { - .uevent = of_device_uevent, -}; -EXPORT_SYMBOL (of_platform_bus_type); - -static int __init of_bus_driver_init (void ) -{ -return of_bus_type_init (&of_platform_bus_type,"of_platform" ); -} - -postcore_initcall (of_bus_driver_init); -static int of_dev_node_match (struct device *dev,void *data) {return to_of_device (dev)->dev.of_node = data;
arch/powerpc/kernel/setup-common.c +0 -7
@@ -701,16 +701,9 @@ static struct notifier_block ppc_dflt_plat_bus_notifier = { .priority = INT_MAX, }; -static struct notifier_block ppc_dflt_of_bus_notifier = { - .notifier_call = ppc_dflt_bus_notify, - .priority =INT_MAX , -}; -static int __init setup_bus_notifier (void ) {bus_register_notifier (&platform_bus_type, &ppc_dflt_plat_bus_notifier); -bus_register_notifier (&of_platform_bus_type, &ppc_dflt_of_bus_notifier); -return 0 ; }
arch/powerpc/platforms/cell/beat_iommu.c +1 -1
@@ -108,7 +108,7 @@ static int __init celleb_init_iommu(void)celleb_init_direct_mapping ();set_pci_dma_ops (&dma_direct_ops); ppc_md.pci_dma_dev_setup = celleb_pci_dma_dev_setup; -bus_register_notifier (&of_platform_bus_type, &celleb_of_bus_notifier); +bus_register_notifier (&platform_bus_type, &celleb_of_bus_notifier);return 0 ; }
arch/powerpc/platforms/cell/iommu.c +1 -1
@@ -1204,7 +1204,7 @@ static int __init cell_iommu_init(void)/* Register callbacks on OF platform device addition/removal * to handle linking them to the right DMA operations */ -bus_register_notifier (&of_platform_bus_type, &cell_of_bus_notifier); +bus_register_notifier (&platform_bus_type, &cell_of_bus_notifier);return 0 ; }
arch/powerpc/sysdev/mv64x60_dev.c +1 -6
@@ -20,12 +20,7 @@#include <asm/prom.h> -/* -* These functions provide the necessary setup for the mv64x60 drivers. -* These drivers are unusual in that they work on both the MIPS and PowerPC -* architectures. Because of that, the drivers do not support the normal -* PowerPC of_platform_bus_type. They support platform_bus_type instead. -*/ +/* These functions provide the necessary setup for the mv64x60 drivers. */ static struct of_device_id __initdata of_mv64x60_devices[] = { { .compatible ="marvell,mv64306-devctrl" , },
arch/sparc/kernel/of_device_32.c +5 -16
@@ -424,7 +424,7 @@ build_resources:build_device_resources (op, parent); op->dev.parent = parent; - op->dev.bus = &of_platform_bus_type; + op->dev.bus = &platform_bus_type;if (!parent)dev_set_name (&op->dev,"root" );else
@@ -452,30 +452,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent) } } -static void __init scan_of_devices (void ) +static int __init scan_of_devices (void ) {struct device_node *root =of_find_node_by_path ("/" );struct of_device *parent; parent =scan_one_device (root,NULL );if (!parent) -return ; +return 0 ;scan_tree (root->child, &parent->dev); +return 0 ; } - -static int __init of_bus_driver_init (void ) -{ -int err; - - err =of_bus_type_init (&of_platform_bus_type,"of" ); -if (!err) -scan_of_devices (); - -return err; -} - -postcore_initcall (of_bus_driver_init); +postcore_initcall (scan_of_devices);static int __init of_debug (char *str) {
arch/sparc/kernel/of_device_64.c +5 -16
@@ -667,7 +667,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp, op->archdata.irqs[i] =build_one_device_irq (op, parent, op->archdata.irqs[i]); op->dev.parent = parent; - op->dev.bus = &of_platform_bus_type; + op->dev.bus = &platform_bus_type;if (!parent)dev_set_name (&op->dev,"root" );else
@@ -695,30 +695,19 @@ static void __init scan_tree(struct device_node *dp, struct device *parent) } } -static void __init scan_of_devices (void ) +static int __init scan_of_devices (void ) {struct device_node *root =of_find_node_by_path ("/" );struct of_device *parent; parent =scan_one_device (root,NULL );if (!parent) -return ; +return 0 ;scan_tree (root->child, &parent->dev); +return 0 ; } - -static int __init of_bus_driver_init (void ) -{ -int err; - - err =of_bus_type_init (&of_platform_bus_type,"of" ); -if (!err) -scan_of_devices (); - -return err; -} - -postcore_initcall (of_bus_driver_init); +postcore_initcall (scan_of_devices);static int __init of_debug (char *str) {
arch/sparc/kernel/of_device_common.c +0 -3
@@ -64,9 +64,6 @@ void of_propagate_archdata(struct of_device *bus) } } -struct bus_type of_platform_bus_type; -EXPORT_SYMBOL (of_platform_bus_type); -static void get_cells (struct device_node *dp,int *addrc,int *sizec) {if (addrc)
drivers/base/platform.c +6 -0
@@ -636,6 +636,12 @@ static struct device_attribute platform_dev_attrs[] = {static int platform_uevent (struct device *dev,struct kobj_uevent_env *env) {struct platform_device *pdev =to_platform_device (dev); +int rc; + +/* Some devices have extra OF data and an OF-style MODALIAS */ + rc =of_device_uevent (dev,env); +if (rc != -ENODEV ) +return rc;add_uevent_var (env,"MODALIAS=%s%s" ,PLATFORM_MODULE_PREFIX , (pdev->id_entry) ? pdev->id_entry->name : pdev->name);
drivers/of/device.c +5 -0
@@ -104,6 +104,11 @@ int of_device_register(struct of_device *ofdev)device_initialize (&ofdev->dev); +/* name and id have to be set so that the platform bus doesn't get +* confused on matching */ + ofdev->name =dev_name (&ofdev->dev); + ofdev->id =-1 ; +/* device_add will assume that this device is on the same node as * the parent. If there is no parent defined, set the node * explicitly */
drivers/of/platform.c +64 -3
93 lines not on this page · raw message
include/linux/of_device.h +6 -0
@@ -65,6 +65,12 @@ static inline int of_driver_match_device(struct device *dev,return 0 ; } +static inline int of_device_uevent (struct device *dev, +struct kobj_uevent_env *env) +{ +return -ENODEV ; +} +#endif /* CONFIG_OF_DEVICE */ #endif /* _LINUX_OF_DEVICE_H */
include/linux/of_platform.h +8 -13
@@ -17,19 +17,19 @@#include <linux/mod_devicetable.h> #include <linux/pm.h> #include <linux/of_device.h> +#include <linux/platform_device.h> /* -* The of_platform_bus_type is a bus type used by drivers that do not -* attach to a macio or similar bus but still use OF probing -* mechanism +* of_platform_bus_type isn't it's own bus anymore. It's now just an alias +* for the platform bus. */ -extern struct bus_type of_platform_bus_type; +#define of_platform_bus_type platform_bus_typeextern const struct of_device_id of_default_bus_ids[];/* * An of_platform_driver driver is attached to a basic of_device on -* the "platform bus" (of_platform_bus_type). +* the "platform bus" (platform_bus_type). */ struct of_platform_driver {
@@ -42,6 +42,7 @@ struct of_platform_driverint (*shutdown)(struct of_device * dev);struct device_driver driver; +struct platform_driver platform_driver; };#define to_of_platform_driver (drv) \ container_of(drv,struct of_platform_driver, driver)
@@ -51,14 +52,8 @@ extern int of_register_driver(struct of_platform_driver *drv,extern void of_unregister_driver (struct of_platform_driver *drv);/* Platform drivers register/unregister */ -static inline int of_register_platform_driver (struct of_platform_driver *drv) -{ -return of_register_driver (drv, &of_platform_bus_type); -} -static inline void of_unregister_platform_driver (struct of_platform_driver *drv) -{ -of_unregister_driver (drv); -} +extern int of_register_platform_driver (struct of_platform_driver *drv); +extern void of_unregister_platform_driver (struct of_platform_driver *drv); extern struct of_device *of_device_alloc(struct device_node *np, const char *bus_id,
Re: [PATCH 2/5] of: Merge of_platform_bus_type with platform_bus_type
From: Grant Likely <[email protected]>
Date: Wed, 21 Jul 2010 17:40:00 -0600
Quoted 12 lines
of_platform_buswas being used in the same manner as theplatform_bus. The only difference being thatof_platform_busdevices are generated from data in the device tree, andplatform_busdevices are usually statically allocated in platform code. Having them separate causes the problem of device drivers having to be registered twice if it was possible for the same device to appear on either bus.This patch removes
of_platform_bus_typeand registers allof_platformbus devices and drivers on the platform bus instead. A previous patch made theof_devicestructure an alias for theplatform_devicestructure, and a shim is used to adaptof_platform_driversto the platform bus.
Quoted 4 lines
After all of
of_platform_busdrivers are converted to be normal platform drivers, the shim code can be removed.Signed-off-by Grant Likely <[email protected]>
PATCH 3/5 of/platform: remove all of_bus_type and of_platform_bus_type references
In reply to Grant LikelyBoth of_bus_type and of_platform_bus_type are just #define aliases for the platform bus. This patch removes all references to them and switches to the of_register_platform_driver()/of_unregister_platform_driver() API for registering.
Subsequent patches will convert each user of of_register_platform_driver() into plain platform_drivers without the of_platform_driver shim. At which point the of_register_platform_driver()/of_unregister_platform_driver() functions can be removed.
--- arch/microblaze/kernel/of_platform.c | 3 +-- arch/powerpc/kernel/of_platform.c | 3 +-- arch/sparc/include/asm/of_platform.h | 2 -- arch/sparc/include/asm/parport.h | 4 +--- arch/sparc/kernel/apc.c | 2 +- arch/sparc/kernel/auxio_64.c | 2 +- arch/sparc/kernel/central.c | 4 ++-- arch/sparc/kernel/chmc.c | 4 ++-- arch/sparc/kernel/of_device_common.c | 2 +- arch/sparc/kernel/pci_fire.c | 2 +- arch/sparc/kernel/pci_psycho.c | 2 +- arch/sparc/kernel/pci_sabre.c | 2 +- arch/sparc/kernel/pci_schizo.c | 2 +- arch/sparc/kernel/pci_sun4v.c | 2 +- arch/sparc/kernel/pmc.c | 2 +- arch/sparc/kernel/power.c | 2 +- arch/sparc/kernel/time_32.c | 2 +- arch/sparc/kernel/time_64.c | 6 +++--- drivers/atm/fore200e.c | 6 +++--- drivers/char/hw_random/n2-drv.c | 4 ++-- drivers/crypto/n2_core.c | 10 +++++----- drivers/hwmon/ultra45_env.c | 4 ++-- drivers/input/misc/sparcspkr.c | 12 +++++------- drivers/input/serio/i8042-sparcio.h | 5 ++--- drivers/mtd/maps/sun_uflash.c | 4 ++-- drivers/net/ibm_newemac/core.c | 4 ++-- drivers/net/myri_sbus.c | 4 ++-- drivers/net/niu.c | 6 +++--- drivers/net/sunbmac.c | 4 ++-- drivers/net/sunhme.c | 4 ++-- drivers/net/sunlance.c | 4 ++-- drivers/net/sunqe.c | 4 ++-- drivers/parport/parport_sunbpp.c | 4 ++-- drivers/sbus/char/bbc_i2c.c | 4 ++-- drivers/sbus/char/display7seg.c | 4 ++-- drivers/sbus/char/envctrl.c | 4 ++-- drivers/sbus/char/flash.c | 4 ++-- drivers/sbus/char/uctrl.c | 4 ++-- drivers/scsi/qlogicpti.c | 4 ++-- drivers/scsi/sun_esp.c | 4 ++-- drivers/serial/sunhv.c | 4 ++-- drivers/serial/sunsab.c | 4 ++-- drivers/serial/sunsu.c | 2 +- drivers/serial/sunzilog.c | 6 +++--- drivers/video/bw2.c | 4 ++-- drivers/video/cg14.c | 4 ++-- drivers/video/cg3.c | 4 ++-- drivers/video/cg6.c | 4 ++-- drivers/video/ffb.c | 4 ++-- drivers/video/leo.c | 4 ++-- drivers/video/p9100.c | 4 ++-- drivers/video/sunxvr1000.c | 4 ++-- drivers/video/tcx.c | 4 ++-- drivers/watchdog/cpwd.c | 4 ++-- drivers/watchdog/riowd.c | 4 ++-- include/linux/of_platform.h | 6 ------ sound/sparc/amd7930.c | 4 ++-- sound/sparc/cs4231.c | 4 ++-- sound/sparc/dbri.c | 4 ++-- 59 files changed, 109 insertions(+), 124 deletions(-)
arch/microblaze/kernel/of_platform.c +1 -2
@@ -57,8 +57,7 @@ struct of_device *of_find_device_by_node(struct device_node *np) {struct device *dev; - dev =bus_find_device (&of_platform_bus_type, -NULL , np, of_dev_node_match); + dev =bus_find_device (&platform_bus_type,NULL , np, of_dev_node_match);if (dev)return to_of_device (dev);return NULL ;
arch/powerpc/kernel/of_platform.c +1 -2
@@ -61,8 +61,7 @@ struct of_device *of_find_device_by_node(struct device_node *np) {struct device *dev; - dev =bus_find_device (&of_platform_bus_type, -NULL , np, of_dev_node_match); + dev =bus_find_device (&platform_bus_type,NULL , np, of_dev_node_match);if (dev)return to_of_device (dev);return NULL ;
arch/sparc/include/asm/of_platform.h +0 -2
@@ -13,6 +13,4 @@* */ -#define of_bus_type of_platform_bus_type/* for compatibility */ -#endif
arch/sparc/include/asm/parport.h +1 -3
@@ -243,9 +243,7 @@ static struct of_platform_driver ecpp_driver = {static int parport_pc_find_nonpci_ports (int autoirq,int autodma) { -of_register_driver (&ecpp_driver, &of_bus_type); - -return 0 ; +return of_register_platform_driver (&ecpp_driver); }#endif /* !(_ASM_SPARC64_PARPORT_H */
arch/sparc/kernel/apc.c +1 -1
@@ -184,7 +184,7 @@ static struct of_platform_driver apc_driver = {static int __init apc_init (void ) { -return of_register_driver (&apc_driver, &of_bus_type); +return of_register_platform_driver (&apc_driver); }/* This driver is not critical to the boot process
arch/sparc/kernel/auxio_64.c +1 -1
@@ -142,7 +142,7 @@ static struct of_platform_driver auxio_driver = {static int __init auxio_init (void ) { -return of_register_driver (&auxio_driver, &of_platform_bus_type); +return of_register_platform_driver (&auxio_driver); }/* Must be after subsys_initcall() so that busses are probed. Must
arch/sparc/kernel/central.c +2 -2
@@ -265,8 +265,8 @@ static struct of_platform_driver fhc_driver = {static int __init sunfire_init (void ) { - (void )of_register_driver (&fhc_driver, &of_platform_bus_type); - (void )of_register_driver (&clock_board_driver, &of_platform_bus_type); + (void )of_register_platform_driver (&fhc_driver); + (void )of_register_platform_driver (&clock_board_driver);return 0 ; }
arch/sparc/kernel/chmc.c +2 -2
@@ -848,7 +848,7 @@ static int __init us3mc_init(void) ret =register_dimm_printer (us3mc_dimm_printer);if (!ret) { - ret =of_register_driver (&us3mc_driver, &of_bus_type); + ret =of_register_platform_driver (&us3mc_driver);if (ret)unregister_dimm_printer (us3mc_dimm_printer); }
@@ -859,7 +859,7 @@ static void __exit us3mc_cleanup(void) {if (us3mc_platform ()) {unregister_dimm_printer (us3mc_dimm_printer); -of_unregister_driver (&us3mc_driver); +of_unregister_platform_driver (&us3mc_driver); } }
arch/sparc/kernel/of_device_common.c +1 -1
@@ -21,7 +21,7 @@ static int node_match(struct device *dev, void *data)struct of_device *of_find_device_by_node (struct device_node *dp) { -struct device *dev =bus_find_device (&of_platform_bus_type,NULL , +struct device *dev =bus_find_device (&platform_bus_type,NULL , dp, node_match);if (dev)
arch/sparc/kernel/pci_fire.c +1 -1
@@ -518,7 +518,7 @@ static struct of_platform_driver fire_driver = {static int __init fire_init (void ) { -return of_register_driver (&fire_driver, &of_bus_type); +return of_register_platform_driver (&fire_driver); }subsys_initcall (fire_init);
arch/sparc/kernel/pci_psycho.c +1 -1
@@ -612,7 +612,7 @@ static struct of_platform_driver psycho_driver = {static int __init psycho_init (void ) { -return of_register_driver (&psycho_driver, &of_bus_type); +return of_register_platform_driver (&psycho_driver); }subsys_initcall (psycho_init);
arch/sparc/kernel/pci_sabre.c +1 -1
@@ -606,7 +606,7 @@ static struct of_platform_driver sabre_driver = {static int __init sabre_init (void ) { -return of_register_driver (&sabre_driver, &of_bus_type); +return of_register_platform_driver (&sabre_driver); }subsys_initcall (sabre_init);
arch/sparc/kernel/pci_schizo.c +1 -1
@@ -1501,7 +1501,7 @@ static struct of_platform_driver schizo_driver = {static int __init schizo_init (void ) { -return of_register_driver (&schizo_driver, &of_bus_type); +return of_register_platform_driver (&schizo_driver); }subsys_initcall (schizo_init);
arch/sparc/kernel/pci_sun4v.c +1 -1
@@ -1019,7 +1019,7 @@ static struct of_platform_driver pci_sun4v_driver = {static int __init pci_sun4v_init (void ) { -return of_register_driver (&pci_sun4v_driver, &of_bus_type); +return of_register_platform_driver (&pci_sun4v_driver); }subsys_initcall (pci_sun4v_init);
arch/sparc/kernel/pmc.c +1 -1
@@ -89,7 +89,7 @@ static struct of_platform_driver pmc_driver = {static int __init pmc_init (void ) { -return of_register_driver (&pmc_driver, &of_bus_type); +return of_register_platform_driver (&pmc_driver); }/* This driver is not critical to the boot process
arch/sparc/kernel/power.c +1 -1
@@ -70,7 +70,7 @@ static struct of_platform_driver power_driver = {static int __init power_init (void ) { -return of_register_driver (&power_driver, &of_platform_bus_type); +return of_register_platform_driver (&power_driver); }device_initcall (power_init);
arch/sparc/kernel/time_32.c +1 -1
@@ -189,7 +189,7 @@ static struct of_platform_driver clock_driver = {/* Probe for the mostek real time clock chip. */ static int __init clock_init (void ) { -return of_register_driver (&clock_driver, &of_platform_bus_type); +return of_register_platform_driver (&clock_driver); }/* Must be after subsys_initcall() so that busses are probed. Must * be before device_initcall() because things like the RTC driver
arch/sparc/kernel/time_64.c +3 -3
@@ -586,9 +586,9 @@ static int __init clock_init(void)if (tlb_type = hypervisor)return platform_device_register (&rtc_sun4v_device); - (void )of_register_driver (&rtc_driver, &of_platform_bus_type); - (void )of_register_driver (&mostek_driver, &of_platform_bus_type); - (void )of_register_driver (&bq4802_driver, &of_platform_bus_type); + (void )of_register_platform_driver (&rtc_driver); + (void )of_register_platform_driver (&mostek_driver); + (void )of_register_platform_driver (&bq4802_driver);return 0 ; }
drivers/atm/fore200e.c +3 -3
@@ -2795,7 +2795,7 @@ static int __init fore200e_module_init(void)printk (FORE200E "FORE Systems 200E-series ATM driver - version " FORE200E_VERSION "\n" );#ifdef CONFIG_SBUS - err =of_register_driver (&fore200e_sba_driver, &of_bus_type); + err =of_register_platform_driver (&fore200e_sba_driver);if (err)return err;#endif
@@ -2806,7 +2806,7 @@ static int __init fore200e_module_init(void)#ifdef CONFIG_SBUS if (err) -of_unregister_driver (&fore200e_sba_driver); +of_unregister_platform_driver (&fore200e_sba_driver);#endif return err;
@@ -2818,7 +2818,7 @@ static void __exit fore200e_module_cleanup(void)pci_unregister_driver (&fore200e_pca_driver);#endif #ifdef CONFIG_SBUS -of_unregister_driver (&fore200e_sba_driver); +of_unregister_platform_driver (&fore200e_sba_driver);#endif }
drivers/char/hw_random/n2-drv.c +2 -2
@@ -762,12 +762,12 @@ static struct of_platform_driver n2rng_driver = {static int __init n2rng_init (void ) { -return of_register_driver (&n2rng_driver, &of_bus_type); +return of_register_platform_driver (&n2rng_driver); } static void __exit n2rng_exit(void) { -of_unregister_driver (&n2rng_driver); +of_unregister_platform_driver (&n2rng_driver); }module_init (n2rng_init);
drivers/crypto/n2_core.c +5 -5
@@ -2070,20 +2070,20 @@ static struct of_platform_driver n2_mau_driver = {static int __init n2_init (void ) { -int err =of_register_driver (&n2_crypto_driver, &of_bus_type); +int err =of_register_platform_driver (&n2_crypto_driver);if (!err) { - err =of_register_driver (&n2_mau_driver, &of_bus_type); + err =of_register_platform_driver (&n2_mau_driver);if (err) -of_unregister_driver (&n2_crypto_driver); +of_unregister_platform_driver (&n2_crypto_driver); }return err; } static void __exit n2_exit(void) { -of_unregister_driver (&n2_mau_driver); -of_unregister_driver (&n2_crypto_driver); +of_unregister_platform_driver (&n2_mau_driver); +of_unregister_platform_driver (&n2_crypto_driver); }module_init (n2_init);
drivers/hwmon/ultra45_env.c +2 -2
@@ -311,12 +311,12 @@ static struct of_platform_driver env_driver = {static int __init env_init (void ) { -return of_register_driver (&env_driver, &of_bus_type); +return of_register_platform_driver (&env_driver); } static void __exit env_exit(void) { -of_unregister_driver (&env_driver); +of_unregister_platform_driver (&env_driver); }module_init (env_init);
drivers/input/misc/sparcspkr.c +5 -7
@@ -353,14 +353,12 @@ static struct of_platform_driver grover_beep_driver = {static int __init sparcspkr_init (void ) { -int err =of_register_driver (&bbc_beep_driver, - &of_platform_bus_type); +int err =of_register_platform_driver (&bbc_beep_driver);if (!err) { - err =of_register_driver (&grover_beep_driver, - &of_platform_bus_type); + err =of_register_platform_driver (&grover_beep_driver);if (err) -of_unregister_driver (&bbc_beep_driver); +of_unregister_platform_driver (&bbc_beep_driver); }return err;
@@ -368,8 +366,8 @@ static int __init sparcspkr_init(void) static void __exit sparcspkr_exit(void) { -of_unregister_driver (&bbc_beep_driver); -of_unregister_driver (&grover_beep_driver); +of_unregister_platform_driver (&bbc_beep_driver); +of_unregister_platform_driver (&grover_beep_driver); }module_init (sparcspkr_init);
drivers/input/serio/i8042-sparcio.h +2 -3
@@ -116,8 +116,7 @@ static int __init i8042_platform_init(void)if (!kbd_iobase)return -ENODEV ; }else { -int err =of_register_driver (&sparc_i8042_driver, - &of_bus_type); +int err =of_register_platform_driver (&sparc_i8042_driver);if (err)return err;
@@ -141,7 +140,7 @@ static inline void i8042_platform_exit(void)struct device_node *root =of_find_node_by_path ("/" );if (strcmp (root->name,"SUNW,JavaStation-1" )) - of_unregister_driver(&sparc_i8042_driver); + of_unregister_platform_driver(&sparc_i8042_driver); }#else /* !CONFIG_PCI */
drivers/mtd/maps/sun_uflash.c +2 -2
@@ -160,12 +160,12 @@ static struct of_platform_driver uflash_driver = {static int __init uflash_init (void ) { -return of_register_driver (&uflash_driver, &of_bus_type); +return of_register_platform_driver (&uflash_driver); } static void __exit uflash_exit(void) { -of_unregister_driver (&uflash_driver); +of_unregister_platform_driver (&uflash_driver); }module_init (uflash_init);
drivers/net/ibm_newemac/core.c +2 -2
@@ -2339,11 +2339,11 @@ static int __devinit emac_wait_deps(struct emac_instance *dev) deps[EMAC_DEP_MDIO_IDX ].phandle = dev->mdio_ph;if (dev->blist && dev->blist > emac_boot_list) deps[EMAC_DEP_PREV_IDX ].phandle =0xffffffffu ; -bus_register_notifier (&of_platform_bus_type, &emac_of_bus_notifier); +bus_register_notifier (&platform_bus_type, &emac_of_bus_notifier);wait_event_timeout (emac_probe_wait,emac_check_deps (dev, deps),EMAC_PROBE_DEP_TIMEOUT ); -bus_unregister_notifier (&of_platform_bus_type, &emac_of_bus_notifier); +bus_unregister_notifier (&platform_bus_type, &emac_of_bus_notifier); err =emac_check_deps (dev, deps) ?0 : -ENODEV ;for (i =0 ; i <EMAC_DEP_COUNT ; i++) {if (deps[i].node)
drivers/net/myri_sbus.c +2 -2
@@ -1172,12 +1172,12 @@ static struct of_platform_driver myri_sbus_driver = {static int __init myri_sbus_init (void ) { -return of_register_driver (&myri_sbus_driver, &of_bus_type); +return of_register_platform_driver (&myri_sbus_driver); } static void __exit myri_sbus_exit(void) { -of_unregister_driver (&myri_sbus_driver); +of_unregister_platform_driver (&myri_sbus_driver); }module_init (myri_sbus_init);
drivers/net/niu.c +3 -3
@@ -10251,14 +10251,14 @@ static int __init niu_init(void) niu_debug =netif_msg_init (debug,NIU_MSG_DEFAULT );#ifdef CONFIG_SPARC64 - err =of_register_driver (&niu_of_driver, &of_bus_type); + err =of_register_platform_driver (&niu_of_driver);#endif if (!err) { err =pci_register_driver (&niu_pci_driver);#ifdef CONFIG_SPARC64 if (err) -of_unregister_driver (&niu_of_driver); +of_unregister_platform_driver (&niu_of_driver);#endif }
@@ -10269,7 +10269,7 @@ static void __exit niu_exit(void) {pci_unregister_driver (&niu_pci_driver);#ifdef CONFIG_SPARC64 -of_unregister_driver (&niu_of_driver); +of_unregister_platform_driver (&niu_of_driver);#endif }
drivers/net/sunbmac.c +2 -2
@@ -1301,12 +1301,12 @@ static struct of_platform_driver bigmac_sbus_driver = {static int __init bigmac_init (void ) { -return of_register_driver (&bigmac_sbus_driver, &of_bus_type); +return of_register_platform_driver (&bigmac_sbus_driver); } static void __exit bigmac_exit(void) { -of_unregister_driver (&bigmac_sbus_driver); +of_unregister_platform_driver (&bigmac_sbus_driver); }module_init (bigmac_init);
drivers/net/sunhme.c +2 -2
@@ -3304,7 +3304,7 @@ static int __init happy_meal_sbus_init(void) {int err; - err =of_register_driver (&hme_sbus_driver, &of_bus_type); + err =of_register_platform_driver (&hme_sbus_driver);if (!err) err =quattro_sbus_register_irqs ();
@@ -3313,7 +3313,7 @@ static int __init happy_meal_sbus_init(void)static void happy_meal_sbus_exit (void ) { -of_unregister_driver (&hme_sbus_driver); +of_unregister_platform_driver (&hme_sbus_driver);quattro_sbus_free_irqs ();while (qfe_sbus_list) {
drivers/net/sunlance.c +2 -2
@@ -1558,12 +1558,12 @@ static struct of_platform_driver sunlance_sbus_driver = {/* Find all the lance cards on the system and initialize them */ static int __init sparc_lance_init (void ) { -return of_register_driver (&sunlance_sbus_driver, &of_bus_type); +return of_register_platform_driver (&sunlance_sbus_driver); } static void __exit sparc_lance_exit(void) { -of_unregister_driver (&sunlance_sbus_driver); +of_unregister_platform_driver (&sunlance_sbus_driver); }module_init (sparc_lance_init);
drivers/net/sunqe.c +2 -2
@@ -988,12 +988,12 @@ static struct of_platform_driver qec_sbus_driver = {static int __init qec_init (void ) { -return of_register_driver (&qec_sbus_driver, &of_bus_type); +return of_register_platform_driver (&qec_sbus_driver); } static void __exit qec_exit(void) { -of_unregister_driver (&qec_sbus_driver); +of_unregister_platform_driver (&qec_sbus_driver);while (root_qec_dev) {struct sunqec *next = root_qec_dev->next_module;
drivers/parport/parport_sunbpp.c +2 -2
@@ -393,12 +393,12 @@ static struct of_platform_driver bpp_sbus_driver = {static int __init parport_sunbpp_init (void ) { -return of_register_driver (&bpp_sbus_driver, &of_bus_type); +return of_register_platform_driver (&bpp_sbus_driver); } static void __exit parport_sunbpp_exit(void) { -of_unregister_driver (&bpp_sbus_driver); +of_unregister_platform_driver (&bpp_sbus_driver); }MODULE_AUTHOR ("Derrick J Brashear" );
drivers/sbus/char/bbc_i2c.c +2 -2
@@ -425,12 +425,12 @@ static struct of_platform_driver bbc_i2c_driver = {static int __init bbc_i2c_init (void ) { -return of_register_driver (&bbc_i2c_driver, &of_bus_type); +return of_register_platform_driver (&bbc_i2c_driver); } static void __exit bbc_i2c_exit(void) { -of_unregister_driver (&bbc_i2c_driver); +of_unregister_platform_driver (&bbc_i2c_driver); }module_init (bbc_i2c_init);
drivers/sbus/char/display7seg.c +2 -2
@@ -277,12 +277,12 @@ static struct of_platform_driver d7s_driver = {static int __init d7s_init (void ) { -return of_register_driver (&d7s_driver, &of_bus_type); +return of_register_platform_driver (&d7s_driver); } static void __exit d7s_exit(void) { -of_unregister_driver (&d7s_driver); +of_unregister_platform_driver (&d7s_driver); }module_init (d7s_init);
drivers/sbus/char/envctrl.c +2 -2
@@ -1142,12 +1142,12 @@ static struct of_platform_driver envctrl_driver = {static int __init envctrl_init (void ) { -return of_register_driver (&envctrl_driver, &of_bus_type); +return of_register_platform_driver (&envctrl_driver); } static void __exit envctrl_exit(void) { -of_unregister_driver (&envctrl_driver); +of_unregister_platform_driver (&envctrl_driver); }module_init (envctrl_init);
drivers/sbus/char/flash.c +2 -2
@@ -218,12 +218,12 @@ static struct of_platform_driver flash_driver = {static int __init flash_init (void ) { -return of_register_driver (&flash_driver, &of_bus_type); +return of_register_platform_driver (&flash_driver); } static void __exit flash_cleanup(void) { -of_unregister_driver (&flash_driver); +of_unregister_platform_driver (&flash_driver); }module_init (flash_init);
drivers/sbus/char/uctrl.c +2 -2
@@ -437,12 +437,12 @@ static struct of_platform_driver uctrl_driver = {static int __init uctrl_init (void ) { -return of_register_driver (&uctrl_driver, &of_bus_type); +return of_register_platform_driver (&uctrl_driver); } static void __exit uctrl_exit(void) { -of_unregister_driver (&uctrl_driver); +of_unregister_platform_driver (&uctrl_driver); }module_init (uctrl_init);
drivers/scsi/qlogicpti.c +2 -2
@@ -1467,12 +1467,12 @@ static struct of_platform_driver qpti_sbus_driver = {static int __init qpti_init (void ) { -return of_register_driver (&qpti_sbus_driver, &of_bus_type); +return of_register_platform_driver (&qpti_sbus_driver); } static void __exit qpti_exit(void) { -of_unregister_driver (&qpti_sbus_driver); +of_unregister_platform_driver (&qpti_sbus_driver); }MODULE_DESCRIPTION ("QlogicISP SBUS driver" );
drivers/scsi/sun_esp.c +2 -2
@@ -644,12 +644,12 @@ static struct of_platform_driver esp_sbus_driver = {static int __init sunesp_init (void ) { -return of_register_driver (&esp_sbus_driver, &of_bus_type); +return of_register_platform_driver (&esp_sbus_driver); } static void __exit sunesp_exit(void) { -of_unregister_driver (&esp_sbus_driver); +of_unregister_platform_driver (&esp_sbus_driver); }MODULE_DESCRIPTION ("Sun ESP SCSI driver" );
drivers/serial/sunhv.c +2 -2
@@ -644,12 +644,12 @@ static int __init sunhv_init(void)if (tlb_type != hypervisor)return -ENODEV ; -return of_register_driver (&hv_driver, &of_bus_type); +return of_register_platform_driver (&hv_driver); } static void __exit sunhv_exit(void) { -of_unregister_driver (&hv_driver); +of_unregister_platform_driver (&hv_driver); }module_init (sunhv_init);
drivers/serial/sunsab.c +2 -2
@@ -1130,12 +1130,12 @@ static int __init sunsab_init(void) } } -return of_register_driver (&sab_driver, &of_bus_type); +return of_register_platform_driver (&sab_driver); } static void __exit sunsab_exit(void) { -of_unregister_driver (&sab_driver); +of_unregister_platform_driver (&sab_driver);if (sunsab_reg.nr) {sunserial_unregister_minors (&sunsab_reg, sunsab_reg.nr); }
drivers/serial/sunsu.c +1 -1
@@ -1581,7 +1581,7 @@ static int __init sunsu_init(void)return err; } - err =of_register_driver (&su_driver, &of_bus_type); + err =of_register_platform_driver (&su_driver);if (err && num_uart)sunserial_unregister_minors (&sunsu_reg, num_uart);
drivers/serial/sunzilog.c +3 -3
@@ -1576,7 +1576,7 @@ static int __init sunzilog_init(void) goto out_free_tables; } - err =of_register_driver (&zs_driver, &of_bus_type); + err =of_register_platform_driver (&zs_driver);if (err) goto out_unregister_uart;
@@ -1604,7 +1604,7 @@ out:return err; out_unregister_driver: -of_unregister_driver (&zs_driver); +of_unregister_platform_driver (&zs_driver); out_unregister_uart:if (num_sunzilog) {
@@ -1619,7 +1619,7 @@ out_free_tables: static void __exit sunzilog_exit(void) { -of_unregister_driver (&zs_driver); +of_unregister_platform_driver (&zs_driver);if (zilog_irq !=-1 ) {struct uart_sunzilog_port *up = sunzilog_irq_chain;
drivers/video/bw2.c +2 -2
@@ -390,12 +390,12 @@ static int __init bw2_init(void)if (fb_get_options ("bw2fb" ,NULL ))return -ENODEV ; -return of_register_driver (&bw2_driver, &of_bus_type); +return of_register_platform_driver (&bw2_driver); } static void __exit bw2_exit(void) { -of_unregister_driver (&bw2_driver); +of_unregister_platform_driver (&bw2_driver); }module_init (bw2_init);
drivers/video/cg14.c +2 -2
@@ -610,12 +610,12 @@ static int __init cg14_init(void)if (fb_get_options ("cg14fb" ,NULL ))return -ENODEV ; -return of_register_driver (&cg14_driver, &of_bus_type); +return of_register_platform_driver (&cg14_driver); } static void __exit cg14_exit(void) { -of_unregister_driver (&cg14_driver); +of_unregister_platform_driver (&cg14_driver); }module_init (cg14_init);
drivers/video/cg3.c +2 -2
@@ -477,12 +477,12 @@ static int __init cg3_init(void)if (fb_get_options ("cg3fb" ,NULL ))return -ENODEV ; -return of_register_driver (&cg3_driver, &of_bus_type); +return of_register_platform_driver (&cg3_driver); } static void __exit cg3_exit(void) { -of_unregister_driver (&cg3_driver); +of_unregister_platform_driver (&cg3_driver); }module_init (cg3_init);
drivers/video/cg6.c +2 -2
@@ -870,12 +870,12 @@ static int __init cg6_init(void)if (fb_get_options ("cg6fb" ,NULL ))return -ENODEV ; -return of_register_driver (&cg6_driver, &of_bus_type); +return of_register_platform_driver (&cg6_driver); } static void __exit cg6_exit(void) { -of_unregister_driver (&cg6_driver); +of_unregister_platform_driver (&cg6_driver); }module_init (cg6_init);
drivers/video/ffb.c +2 -2
@@ -1067,12 +1067,12 @@ static int __init ffb_init(void)if (fb_get_options ("ffb" ,NULL ))return -ENODEV ; -return of_register_driver (&ffb_driver, &of_bus_type); +return of_register_platform_driver (&ffb_driver); } static void __exit ffb_exit(void) { -of_unregister_driver (&ffb_driver); +of_unregister_platform_driver (&ffb_driver); }module_init (ffb_init);
drivers/video/leo.c +2 -2
@@ -677,12 +677,12 @@ static int __init leo_init(void)if (fb_get_options ("leofb" ,NULL ))return -ENODEV ; -return of_register_driver (&leo_driver, &of_bus_type); +return of_register_platform_driver (&leo_driver); } static void __exit leo_exit(void) { -of_unregister_driver (&leo_driver); +of_unregister_platform_driver (&leo_driver); }module_init (leo_init);
drivers/video/p9100.c +2 -2
@@ -367,12 +367,12 @@ static int __init p9100_init(void)if (fb_get_options ("p9100fb" ,NULL ))return -ENODEV ; -return of_register_driver (&p9100_driver, &of_bus_type); +return of_register_platform_driver (&p9100_driver); } static void __exit p9100_exit(void) { -of_unregister_driver (&p9100_driver); +of_unregister_platform_driver (&p9100_driver); }module_init (p9100_init);
drivers/video/sunxvr1000.c +2 -2
@@ -213,12 +213,12 @@ static int __init gfb_init(void)if (fb_get_options ("gfb" ,NULL ))return -ENODEV ; -return of_register_driver (&gfb_driver, &of_bus_type); +return of_register_platform_driver (&gfb_driver); } static void __exit gfb_exit(void) { -of_unregister_driver (&gfb_driver); +of_unregister_platform_driver (&gfb_driver); }module_init (gfb_init);
drivers/video/tcx.c +2 -2
@@ -526,12 +526,12 @@ static int __init tcx_init(void)if (fb_get_options ("tcxfb" ,NULL ))return -ENODEV ; -return of_register_driver (&tcx_driver, &of_bus_type); +return of_register_platform_driver (&tcx_driver); } static void __exit tcx_exit(void) { -of_unregister_driver (&tcx_driver); +of_unregister_platform_driver (&tcx_driver); }module_init (tcx_init);
drivers/watchdog/cpwd.c +2 -2
@@ -688,12 +688,12 @@ static struct of_platform_driver cpwd_driver = {static int __init cpwd_init (void ) { -return of_register_driver (&cpwd_driver, &of_bus_type); +return of_register_platform_driver (&cpwd_driver); } static void __exit cpwd_exit(void) { -of_unregister_driver (&cpwd_driver); +of_unregister_platform_driver (&cpwd_driver); }module_init (cpwd_init);
drivers/watchdog/riowd.c +2 -2
@@ -250,12 +250,12 @@ static struct of_platform_driver riowd_driver = {static int __init riowd_init (void ) { -return of_register_driver (&riowd_driver, &of_bus_type); +return of_register_platform_driver (&riowd_driver); } static void __exit riowd_exit(void) { -of_unregister_driver (&riowd_driver); +of_unregister_platform_driver (&riowd_driver); }module_init (riowd_init);
include/linux/of_platform.h +0 -6
@@ -19,12 +19,6 @@#include <linux/of_device.h> #include <linux/platform_device.h> -/* -* of_platform_bus_type isn't it's own bus anymore. It's now just an alias -* for the platform bus. -*/ -#define of_platform_bus_type platform_bus_type -extern const struct of_device_id of_default_bus_ids[];/*
sound/sparc/amd7930.c +2 -2
@@ -1075,7 +1075,7 @@ static struct of_platform_driver amd7930_sbus_driver = {static int __init amd7930_init (void ) { -return of_register_driver (&amd7930_sbus_driver, &of_bus_type); +return of_register_platform_driver (&amd7930_sbus_driver); } static void __exit amd7930_exit(void)
@@ -1092,7 +1092,7 @@ static void __exit amd7930_exit(void) amd7930_list =NULL ; -of_unregister_driver (&amd7930_sbus_driver); +of_unregister_platform_driver (&amd7930_sbus_driver); }module_init (amd7930_init);
sound/sparc/cs4231.c +2 -2
@@ -2120,12 +2120,12 @@ static struct of_platform_driver cs4231_driver = {static int __init cs4231_init (void ) { -return of_register_driver (&cs4231_driver, &of_bus_type); +return of_register_platform_driver (&cs4231_driver); } static void __exit cs4231_exit(void) { -of_unregister_driver (&cs4231_driver); +of_unregister_platform_driver (&cs4231_driver); }module_init (cs4231_init);
sound/sparc/dbri.c +2 -2
@@ -2699,12 +2699,12 @@ static struct of_platform_driver dbri_sbus_driver = {/* Probe for the dbri chip and then attach the driver. */ static int __init dbri_init (void ) { -return of_register_driver (&dbri_sbus_driver, &of_bus_type); +return of_register_platform_driver (&dbri_sbus_driver); } static void __exit dbri_exit(void) { -of_unregister_driver (&dbri_sbus_driver); +of_unregister_platform_driver (&dbri_sbus_driver); }module_init (dbri_init);
Re: [PATCH 3/5] of/platform: remove all of_bus_type and of_platform_bus_type references
From: Grant Likely <[email protected]>
Date: Wed, 21 Jul 2010 17:40:05 -0600
Quoted 11 lines
Both
of_bus_typeandof_platform_bus_typeare just #define aliases for the platform bus. This patch removes all references to them and switches to the of_register_platform_driver()/of_unregister_platform_driver() API for registering.Subsequent patches will convert each user of
of_register_platform_driver()into plainplatform_driverswithout theof_platform_drivershim. At which point the of_register_platform_driver()/of_unregister_platform_driver() functions can be removed.Signed-off-by Grant Likely <[email protected]>
PATCH 4/5 of: remove asm/of_platform.h
In reply to Grant LikelyOnly thing left in it is of_instantiate_rtc() which can be moved to asm/prom.h on PowerPC and is unused in microblaze.
--- arch/microblaze/include/asm/of_platform.h | 19 ------------------- arch/powerpc/include/asm/of_platform.h | 16 ---------------- arch/powerpc/include/asm/prom.h | 2 ++ arch/sparc/include/asm/of_platform.h | 16 ---------------- include/linux/of_platform.h | 2 -- 5 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 arch/microblaze/include/asm/of_platform.h delete mode 100644 arch/powerpc/include/asm/of_platform.h delete mode 100644 arch/sparc/include/asm/of_platform.h
arch/microblaze/include/asm/of_platform.h deleted +0 -19
@@ -1,19 +0,0 @@ -/* -* Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. -* <[email protected]> -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -*/ - -#ifndef _ASM_MICROBLAZE_OF_PLATFORM_H -#define _ASM_MICROBLAZE_OF_PLATFORM_H - -/* This is just here during the transition */ -#include <linux/of_platform.h> - -extern void of_instantiate_rtc (void ); - -#endif /* _ASM_MICROBLAZE_OF_PLATFORM_H */
arch/powerpc/include/asm/of_platform.h deleted +0 -16
@@ -1,16 +0,0 @@ -#ifndef _ASM_POWERPC_OF_PLATFORM_H -#define _ASM_POWERPC_OF_PLATFORM_H -/* -* Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. -* <[email protected]> -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* -*/ - -extern void of_instantiate_rtc (void ); - -#endif /* _ASM_POWERPC_OF_PLATFORM_H */
arch/powerpc/include/asm/prom.h +2 -0
@@ -117,5 +117,7 @@ extern const void *of_get_mac_address(struct device_node *np);struct pci_dev ;extern int of_irq_map_pci (struct pci_dev *pdev,struct of_irq *out_irq); +extern void of_instantiate_rtc (void ); +#endif /* __KERNEL__ */ #endif /* _POWERPC_PROM_H */
arch/sparc/include/asm/of_platform.h deleted +0 -16
@@ -1,16 +0,0 @@ -#ifndef ___ASM_SPARC_OF_PLATFORM_H -#define ___ASM_SPARC_OF_PLATFORM_H -/* -* Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. -* <[email protected]> -* Modified for Sparc by merging parts of asm/of_device.h -* by Stephen Rothwell -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version -* 2 of the License, or (at your option) any later version. -* -*/ - -#endif
include/linux/of_platform.h +0 -2
@@ -52,8 +52,6 @@ extern void of_unregister_platform_driver(struct of_platform_driver *drv);extern struct of_device *of_device_alloc (struct device_node *np,const char *bus_id,struct device *parent); -#include <asm/of_platform.h> -extern struct of_device *of_find_device_by_node (struct device_node *np);extern int of_bus_type_init (struct bus_type *bus,const char *name);
Re: [PATCH 4/5] of: remove asm/of_platform.h
From: Grant Likely <[email protected]>
Date: Wed, 21 Jul 2010 17:40:10 -0600
Quoted 4 lines
Only thing left in it is
of_instantiate_rtc()which can be moved toasm/prom.hon PowerPC and is unused in microblaze.Signed-off-by Grant Likely <[email protected]>
PATCH 5/5 of: remove asm/of_device.h
In reply to Grant LikelyIt is mostly unused now. Sparc has a few defines left in it, but they can be moved to other headers. Removing this header means that new architectures adding CONFIG_OF support don't need to also add this header file.
--- arch/microblaze/include/asm/of_device.h | 13 ------------- arch/powerpc/include/asm/of_device.h | 3 --- arch/sparc/include/asm/device.h | 2 ++ arch/sparc/include/asm/of_device.h | 19 ------------------- arch/sparc/include/asm/prom.h | 4 ++++ include/linux/of_device.h | 2 +- 6 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 arch/microblaze/include/asm/of_device.h delete mode 100644 arch/powerpc/include/asm/of_device.h delete mode 100644 arch/sparc/include/asm/of_device.h
arch/microblaze/include/asm/of_device.h deleted +0 -13
@@ -1,13 +0,0 @@ -/* -* Copyright (C) 2007-2008 Michal Simek <[email protected]> -* -* based on PowerPC of_device.h -* -* This file is subject to the terms and conditions of the GNU General Public -* License. See the file "COPYING" in the main directory of this archive -* for more details. -*/ - -#ifndef _ASM_MICROBLAZE_OF_DEVICE_H -#define _ASM_MICROBLAZE_OF_DEVICE_H -#endif /* _ASM_MICROBLAZE_OF_DEVICE_H */
arch/powerpc/include/asm/of_device.h deleted +0 -3
@@ -1,3 +0,0 @@ -#ifndef _ASM_POWERPC_OF_DEVICE_H -#define _ASM_POWERPC_OF_DEVICE_H -#endif /* _ASM_POWERPC_OF_DEVICE_H */
arch/sparc/include/asm/device.h +2 -0
@@ -19,6 +19,8 @@ struct dev_archdata {int numa_node; }; +extern void of_propagate_archdata (struct platform_device *bus); +struct pdev_archdata {struct resource resource[PROMREG_MAX ];unsigned int irqs[PROMINTR_MAX ];
arch/sparc/include/asm/of_device.h deleted +0 -19
@@ -1,19 +0,0 @@ -#ifndef _ASM_SPARC_OF_DEVICE_H -#define _ASM_SPARC_OF_DEVICE_H -#ifdef __KERNEL__ - -#include <linux/device.h> -#include <linux/of.h> -#include <linux/mod_devicetable.h> -#include <asm/openprom.h> - -extern void __iomem *of_ioremap (struct resource *res,unsigned long offset,unsigned long size,char *name); -extern void of_iounmap (struct resource *res,void __iomem *base,unsigned long size); - -extern void of_propagate_archdata (struct of_device *bus); - -/* This is just here during the transition */ -#include <linux/of_platform.h> - -#endif /* __KERNEL__ */ -#endif /* _ASM_SPARC_OF_DEVICE_H */
arch/sparc/include/asm/prom.h +4 -0
@@ -51,6 +51,10 @@ extern void prom_build_devicetree(void);extern void of_populate_present_mask (void );extern void of_fill_in_cpu_data (void ); +struct resource ; +extern void __iomem *of_ioremap (struct resource *res,unsigned long offset,unsigned long size,char *name); +extern void of_iounmap (struct resource *res,void __iomem *base,unsigned long size); +/* These routines are here to provide compatibility with how powerpc * handles IRQ mapping for OF device nodes. We precompute and permanently * register them in the of_device objects, whereas powerpc computes them
include/linux/of_device.h +1 -1
@@ -16,12 +16,12 @@*/ #define of_device platform_device#include <linux/platform_device.h> +#include <linux/of_platform.h> /* temporary until merge */ #ifdef CONFIG_OF_DEVICE #include <linux/device.h> #include <linux/of.h> #include <linux/mod_devicetable.h> -#include <asm/of_device.h> #define to_of_device (d) container_of(d, struct of_device, dev)
Re: [PATCH 5/5] of: remove asm/of_device.h
From: Grant Likely <[email protected]>
Date: Wed, 21 Jul 2010 17:40:15 -0600
Quoted 6 lines
It is mostly unused now. Sparc has a few defines left in it, but they can be moved to other headers. Removing this header means that new architectures adding
CONFIG_OFsupport don't need to also add this header file.Signed-off-by Grant Likely <[email protected]>
David Miller
maintainerFrom: Grant Likely <[email protected]>
Date: Wed, 21 Jul 2010 17:39:49 -0600
Quoted 2 lines
David, you'll also want to take a look at patches 4 & 5 to see if you agree with my decisions on where I move symbols in the header files.
Looks fine to me.