Skip to content

Commit

Permalink
[SPARC/64]: Prepare to remove of_platform_driver name.
Browse files Browse the repository at this point in the history
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: Stephen Rothwell <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
sfrothwell authored and David S. Miller committed Oct 14, 2007
1 parent e8dd161 commit fa7744d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Documentation/sparc/sbus_drivers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ probe in an SBUS driver under Linux:
MODULE_DEVICE_TABLE(of, mydevice_match);

static struct of_platform_driver mydevice_driver = {
.name = "mydevice",
.match_table = mydevice_match,
.probe = mydevice_probe,
.remove = __devexit_p(mydevice_remove),
.driver = {
.name = "mydevice",
},
};

static int __init mydevice_init(void)
Expand Down
5 changes: 4 additions & 1 deletion arch/sparc/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,10 @@ __setup("of_debug=", of_debug);
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
{
/* 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;

/* register with core */
Expand Down
5 changes: 4 additions & 1 deletion arch/sparc64/kernel/of_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,10 @@ __setup("of_debug=", of_debug);
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
{
/* 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;

/* register with core */
Expand Down

0 comments on commit fa7744d

Please sign in to comment.