Commit 1ab1d63a authored by Grant Likely's avatar Grant Likely
Browse files

of/platform: remove all of_bus_type and of_platform_bus_type references



Both 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.
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eca39301
......@@ -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;
......
......@@ -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;
......
......@@ -13,6 +13,4 @@
*
*/
#define of_bus_type of_platform_bus_type /* for compatibility */
#endif
......@@ -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 */
......@@ -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
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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);
}
}
......
......@@ -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)
......
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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);
......@@ -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
......
......@@ -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);
......@@ -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
......
......@@ -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;
}
......
......@@ -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
}
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment