Skip to content

Commit 1ab1d63

Browse files
committed
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: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net>
1 parent eca3930 commit 1ab1d63

59 files changed

Lines changed: 109 additions & 124 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/microblaze/kernel/of_platform.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ struct of_device *of_find_device_by_node(struct device_node *np)
5757
{
5858
struct device *dev;
5959

60-
dev = bus_find_device(&of_platform_bus_type,
61-
NULL, np, of_dev_node_match);
60+
dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match);
6261
if (dev)
6362
return to_of_device(dev);
6463
return NULL;

‎arch/powerpc/kernel/of_platform.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ struct of_device *of_find_device_by_node(struct device_node *np)
6161
{
6262
struct device *dev;
6363

64-
dev = bus_find_device(&of_platform_bus_type,
65-
NULL, np, of_dev_node_match);
64+
dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match);
6665
if (dev)
6766
return to_of_device(dev);
6867
return NULL;

‎arch/sparc/include/asm/of_platform.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@
1313
*
1414
*/
1515

16-
#define of_bus_type of_platform_bus_type /* for compatibility */
17-
1816
#endif

‎arch/sparc/include/asm/parport.h‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ static struct of_platform_driver ecpp_driver = {
243243

244244
static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
245245
{
246-
of_register_driver(&ecpp_driver, &of_bus_type);
247-
248-
return 0;
246+
return of_register_platform_driver(&ecpp_driver);
249247
}
250248

251249
#endif /* !(_ASM_SPARC64_PARPORT_H */

‎arch/sparc/kernel/apc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static struct of_platform_driver apc_driver = {
184184

185185
static int __init apc_init(void)
186186
{
187-
return of_register_driver(&apc_driver, &of_bus_type);
187+
return of_register_platform_driver(&apc_driver);
188188
}
189189

190190
/* This driver is not critical to the boot process

‎arch/sparc/kernel/auxio_64.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static struct of_platform_driver auxio_driver = {
142142

143143
static int __init auxio_init(void)
144144
{
145-
return of_register_driver(&auxio_driver, &of_platform_bus_type);
145+
return of_register_platform_driver(&auxio_driver);
146146
}
147147

148148
/* Must be after subsys_initcall() so that busses are probed. Must

‎arch/sparc/kernel/central.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ static struct of_platform_driver fhc_driver = {
265265

266266
static int __init sunfire_init(void)
267267
{
268-
(void) of_register_driver(&fhc_driver, &of_platform_bus_type);
269-
(void) of_register_driver(&clock_board_driver, &of_platform_bus_type);
268+
(void) of_register_platform_driver(&fhc_driver);
269+
(void) of_register_platform_driver(&clock_board_driver);
270270
return 0;
271271
}
272272

‎arch/sparc/kernel/chmc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ static int __init us3mc_init(void)
848848
ret = register_dimm_printer(us3mc_dimm_printer);
849849

850850
if (!ret) {
851-
ret = of_register_driver(&us3mc_driver, &of_bus_type);
851+
ret = of_register_platform_driver(&us3mc_driver);
852852
if (ret)
853853
unregister_dimm_printer(us3mc_dimm_printer);
854854
}
@@ -859,7 +859,7 @@ static void __exit us3mc_cleanup(void)
859859
{
860860
if (us3mc_platform()) {
861861
unregister_dimm_printer(us3mc_dimm_printer);
862-
of_unregister_driver(&us3mc_driver);
862+
of_unregister_platform_driver(&us3mc_driver);
863863
}
864864
}
865865

‎arch/sparc/kernel/of_device_common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int node_match(struct device *dev, void *data)
2121

2222
struct of_device *of_find_device_by_node(struct device_node *dp)
2323
{
24-
struct device *dev = bus_find_device(&of_platform_bus_type, NULL,
24+
struct device *dev = bus_find_device(&platform_bus_type, NULL,
2525
dp, node_match);
2626

2727
if (dev)

‎arch/sparc/kernel/pci_fire.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ static struct of_platform_driver fire_driver = {
518518

519519
static int __init fire_init(void)
520520
{
521-
return of_register_driver(&fire_driver, &of_bus_type);
521+
return of_register_platform_driver(&fire_driver);
522522
}
523523

524524
subsys_initcall(fire_init);

0 commit comments

Comments
 (0)