Commit fa7744db authored by Stephen Rothwell's avatar Stephen Rothwell Committed by David S. Miller

[SPARC/64]: Prepare to remove of_platform_driver name.

The name field of of_platform_driver is just copied into the
included device_driver.  By not overriding an already initialised
device_driver name, we can convert the drivers over time to stop using
the of_platform_driver name.

Also we were not copying the owner field from of_platform_driver, so do
the same with it.
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e8dd1612
...@@ -67,10 +67,12 @@ probe in an SBUS driver under Linux: ...@@ -67,10 +67,12 @@ probe in an SBUS driver under Linux:
MODULE_DEVICE_TABLE(of, mydevice_match); MODULE_DEVICE_TABLE(of, mydevice_match);
static struct of_platform_driver mydevice_driver = { static struct of_platform_driver mydevice_driver = {
.name = "mydevice",
.match_table = mydevice_match, .match_table = mydevice_match,
.probe = mydevice_probe, .probe = mydevice_probe,
.remove = __devexit_p(mydevice_remove), .remove = __devexit_p(mydevice_remove),
.driver = {
.name = "mydevice",
},
}; };
static int __init mydevice_init(void) static int __init mydevice_init(void)
......
...@@ -588,7 +588,10 @@ __setup("of_debug=", of_debug); ...@@ -588,7 +588,10 @@ __setup("of_debug=", of_debug);
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
{ {
/* initialize common driver fields */ /* initialize common driver fields */
drv->driver.name = drv->name; if (!drv->driver.name)
drv->driver.name = drv->name;
if (!drv->driver.owner)
drv->driver.owner = drv->owner;
drv->driver.bus = bus; drv->driver.bus = bus;
/* register with core */ /* register with core */
......
...@@ -872,7 +872,10 @@ __setup("of_debug=", of_debug); ...@@ -872,7 +872,10 @@ __setup("of_debug=", of_debug);
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
{ {
/* initialize common driver fields */ /* initialize common driver fields */
drv->driver.name = drv->name; if (!drv->driver.name)
drv->driver.name = drv->name;
if (!drv->driver.owner)
drv->driver.owner = drv->owner;
drv->driver.bus = bus; drv->driver.bus = bus;
/* register with core */ /* register with core */
......
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