Skip to content

Commit fa7744d

Browse files
sfrothwellDavid S. Miller
authored andcommitted
[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: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e8dd161 commit fa7744d

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎Documentation/sparc/sbus_drivers.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ probe in an SBUS driver under Linux:
6767
MODULE_DEVICE_TABLE(of, mydevice_match);
6868

6969
static struct of_platform_driver mydevice_driver = {
70-
.name = "mydevice",
7170
.match_table = mydevice_match,
7271
.probe = mydevice_probe,
7372
.remove = __devexit_p(mydevice_remove),
73+
.driver = {
74+
.name = "mydevice",
75+
},
7476
};
7577

7678
static int __init mydevice_init(void)

‎arch/sparc/kernel/of_device.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,10 @@ __setup("of_debug=", of_debug);
588588
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
589589
{
590590
/* 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;
592595
drv->driver.bus = bus;
593596

594597
/* register with core */

‎arch/sparc64/kernel/of_device.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,10 @@ __setup("of_debug=", of_debug);
872872
int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
873873
{
874874
/* 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;
876879
drv->driver.bus = bus;
877880

878881
/* register with core */

0 commit comments

Comments
 (0)