Skip to contentSkip to conversation

Prepare to remove of_platform_driver name

PATCH Applied Stephen Rothwell 2 participants 2 messages Sep 21, 2007 – Sep 27, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 Documentation/sparc/sbus_drivers.txt |    4 +++-
 arch/sparc/kernel/of_device.c        |    5 ++++-
 arch/sparc64/kernel/of_device.c      |    5 ++++-
 3 files changed, 11 insertions(+), 3 deletions(-)

Do you guys want these split SPARC/SPARC64?

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
Documentation/sparc/sbus_drivers.txt +3 -1
index 8418d35..eb1e28a 100644
@@ -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)
arch/sparc/kernel/of_device.c +4 -1
index 36383f7..fb2caef 100644
@@ -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 */
arch/sparc64/kernel/of_device.c +4 -1
index 4cc7748..42d7798 100644
@@ -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 */
Signature · 1 line
1.5.3.2
maintainer Applied
#1 lore raw

From: Stephen Rothwell <[email protected]>
Date: Fri, 21 Sep 2007 18:10:41 +1000

Quoted 9 lines

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.

I've queued this up for 2.6.24, thanks!

Quoted 1 line

Do you guys want these split SPARC/SPARC64?

No, it actually makes more work for me :-)