public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net48xx LED cleanups
@ 2006-07-11 20:50 Chris Boot
  2006-07-11 20:53 ` Chris Boot
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Boot @ 2006-07-11 20:50 UTC (permalink / raw)
  To: kernel list; +Cc: Andrew Morton, ben-linux, rpurdie, Jim Cromie

Add the DRVNAME define to remove the two separate references of the driver name 
by string, and move the .driver.owner into the existing .driver sub-structure 
(or whatever it's called).

Signed-off-by: Chris Boot <bootc@bootc.net>

diff --git a/drivers/leds/leds-net48xx.c b/drivers/leds/leds-net48xx.c
index 35ee52f..713c4a8 100644
--- a/drivers/leds/leds-net48xx.c
+++ b/drivers/leds/leds-net48xx.c
@@ -18,6 +18,7 @@
  #include <asm/io.h>
  #include <linux/scx200_gpio.h>

+#define DRVNAME "net48xx-led"
  #define NET48XX_ERROR_LED_GPIO	20

  static struct platform_device *pdev;
@@ -66,13 +67,13 @@ static int net48xx_led_remove(struct pla
  }

  static struct platform_driver net48xx_led_driver = {
-	.driver.owner	= THIS_MODULE,
  	.probe		= net48xx_led_probe,
  	.remove		= net48xx_led_remove,
  	.suspend	= net48xx_led_suspend,
  	.resume		= net48xx_led_resume,
  	.driver		= {
-		.name = "net48xx-led",
+		.name		= DRVNAME,
+		.owner		= THIS_MODULE,
  	},
  };

@@ -89,7 +90,7 @@ static int __init net48xx_led_init(void)
  	if (ret < 0)
  		goto out;

-	pdev = platform_device_register_simple("net48xx-led", -1, NULL, 0);
+	pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0);
  	if (IS_ERR(pdev)) {
  		ret = PTR_ERR(pdev);
  		platform_driver_unregister(&net48xx_led_driver);

-- 
Chris Boot
bootc@bootc.net
http://www.bootc.net/

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net48xx LED cleanups
  2006-07-11 20:50 [PATCH] net48xx LED cleanups Chris Boot
@ 2006-07-11 20:53 ` Chris Boot
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Boot @ 2006-07-11 20:53 UTC (permalink / raw)
  To: Chris Boot; +Cc: kernel list, Andrew Morton, ben-linux, rpurdie, Jim Cromie

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

Chris Boot wrote:
> Add the DRVNAME define to remove the two separate references of the 
> driver name by string, and move the .driver.owner into the existing 
> .driver sub-structure (or whatever it's called).
> 
> Signed-off-by: Chris Boot <bootc@bootc.net>

Never trust Thunderbird. Attached.

-- 
Chris Boot
bootc@bootc.net
http://www.bootc.net/

[-- Attachment #2: net48xx-led-cleanup.patch --]
[-- Type: text/x-patch, Size: 1050 bytes --]

diff --git a/drivers/leds/leds-net48xx.c b/drivers/leds/leds-net48xx.c
index 35ee52f..713c4a8 100644
--- a/drivers/leds/leds-net48xx.c
+++ b/drivers/leds/leds-net48xx.c
@@ -18,6 +18,7 @@
 #include <asm/io.h>
 #include <linux/scx200_gpio.h>
 
+#define DRVNAME "net48xx-led"
 #define NET48XX_ERROR_LED_GPIO	20
 
 static struct platform_device *pdev;
@@ -66,13 +67,13 @@ static int net48xx_led_remove(struct pla
 }
 
 static struct platform_driver net48xx_led_driver = {
-	.driver.owner	= THIS_MODULE,
 	.probe		= net48xx_led_probe,
 	.remove		= net48xx_led_remove,
 	.suspend	= net48xx_led_suspend,
 	.resume		= net48xx_led_resume,
 	.driver		= {
-		.name = "net48xx-led",
+		.name		= DRVNAME,
+		.owner		= THIS_MODULE,
 	},
 };
 
@@ -89,7 +90,7 @@ static int __init net48xx_led_init(void)
 	if (ret < 0)
 		goto out;
 
-	pdev = platform_device_register_simple("net48xx-led", -1, NULL, 0);
+	pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0);
 	if (IS_ERR(pdev)) {
 		ret = PTR_ERR(pdev);
 		platform_driver_unregister(&net48xx_led_driver);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-11 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-11 20:50 [PATCH] net48xx LED cleanups Chris Boot
2006-07-11 20:53 ` Chris Boot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox