aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sparc/sbus_drivers.txt4
-rw-r--r--arch/sparc/kernel/of_device.c5
-rw-r--r--arch/sparc64/kernel/of_device.c5
3 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/sparc/sbus_drivers.txt b/Documentation/sparc/sbus_drivers.txt
index 8418d35484fc..eb1e28ad8822 100644
--- a/Documentation/sparc/sbus_drivers.txt
+++ b/Documentation/sparc/sbus_drivers.txt
@@ -67,10 +67,12 @@ probe in an SBUS driver under Linux:
67 MODULE_DEVICE_TABLE(of, mydevice_match); 67 MODULE_DEVICE_TABLE(of, mydevice_match);
68 68
69 static struct of_platform_driver mydevice_driver = { 69 static struct of_platform_driver mydevice_driver = {
70 .name = "mydevice",
71 .match_table = mydevice_match, 70 .match_table = mydevice_match,
72 .probe = mydevice_probe, 71 .probe = mydevice_probe,
73 .remove = __devexit_p(mydevice_remove), 72 .remove = __devexit_p(mydevice_remove),
73 .driver = {
74 .name = "mydevice",
75 },
74 }; 76 };
75 77
76 static int __init mydevice_init(void) 78 static int __init mydevice_init(void)
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index 36383f73d685..fb2caef79cec 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -588,7 +588,10 @@ __setup("of_debug=", of_debug);
588int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) 588int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
589{ 589{
590 /* initialize common driver fields */ 590 /* initialize common driver fields */
591 drv->driver.name = drv->name; 591 if (!drv->driver.name)
592 drv->driver.name = drv->name;
593 if (!drv->driver.owner)
594 drv->driver.owner = drv->owner;
592 drv->driver.bus = bus; 595 drv->driver.bus = bus;
593 596
594 /* register with core */ 597 /* register with core */
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 4cc77485f536..42d779866fba 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -872,7 +872,10 @@ __setup("of_debug=", of_debug);
872int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) 872int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
873{ 873{
874 /* initialize common driver fields */ 874 /* initialize common driver fields */
875 drv->driver.name = drv->name; 875 if (!drv->driver.name)
876 drv->driver.name = drv->name;
877 if (!drv->driver.owner)
878 drv->driver.owner = drv->owner;
876 drv->driver.bus = bus; 879 drv->driver.bus = bus;
877 880
878 /* register with core */ 881 /* register with core */