linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] MIPS: SEAD3: Fix LED device registration.
       [not found] <20141023235416.GA7529@linux-mips.org>
@ 2014-10-23 22:41 ` Ralf Baechle
  2014-10-23 23:32 ` [PATCH 2/3] MIPS: SEAD3: Collect LED platform device registration in a single file Ralf Baechle
  2014-10-23 23:50 ` [PATCH 3/3] LED/MIPS: Move SEAD3 LED driver to where it belongs Ralf Baechle
  2 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2014-10-23 22:41 UTC (permalink / raw)
  To: Markos Chandras, linux-mips, Bryan Wu, Richard Purdie, linux-leds

This isn't a module and shouldn't be one.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
 arch/mips/mti-sead3/sead3-leds.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/mips/mti-sead3/sead3-leds.c b/arch/mips/mti-sead3/sead3-leds.c
index 20102a6..c427c57 100644
--- a/arch/mips/mti-sead3/sead3-leds.c
+++ b/arch/mips/mti-sead3/sead3-leds.c
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
  */
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 
@@ -76,8 +76,4 @@ static int __init led_init(void)
 	return platform_device_register(&fled_device);
 }
 
-module_init(led_init);
-
-MODULE_AUTHOR("Chris Dearman <chris@mips.com>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("LED probe driver for SEAD-3");
+device_initcall(led_init);
-- 
1.9.3

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

* [PATCH 2/3] MIPS: SEAD3: Collect LED platform device registration in a single file.
       [not found] <20141023235416.GA7529@linux-mips.org>
  2014-10-23 22:41 ` [PATCH 1/3] MIPS: SEAD3: Fix LED device registration Ralf Baechle
@ 2014-10-23 23:32 ` Ralf Baechle
  2014-10-23 23:50 ` [PATCH 3/3] LED/MIPS: Move SEAD3 LED driver to where it belongs Ralf Baechle
  2 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2014-10-23 23:32 UTC (permalink / raw)
  To: Markos Chandras, linux-mips, Bryan Wu, Richard Purdie, linux-leds

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
 arch/mips/mti-sead3/leds-sead3.c | 19 +------------------
 arch/mips/mti-sead3/sead3-leds.c | 18 ++++++++++++++----
 2 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/arch/mips/mti-sead3/leds-sead3.c b/arch/mips/mti-sead3/leds-sead3.c
index 0a168c9..e5632e6 100644
--- a/arch/mips/mti-sead3/leds-sead3.c
+++ b/arch/mips/mti-sead3/leds-sead3.c
@@ -15,8 +15,6 @@
 
 #define DRVNAME "sead3-led"
 
-static struct platform_device *pdev;
-
 static void sead3_pled_set(struct led_classdev *led_cdev,
 		enum led_brightness value)
 {
@@ -76,26 +74,11 @@ static struct platform_driver sead3_led_driver = {
 
 static int __init sead3_led_init(void)
 {
-	int ret;
-
-	ret = platform_driver_register(&sead3_led_driver);
-	if (ret < 0)
-		goto out;
-
-	pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0);
-	if (IS_ERR(pdev)) {
-		ret = PTR_ERR(pdev);
-		platform_driver_unregister(&sead3_led_driver);
-		goto out;
-	}
-
-out:
-	return ret;
+	return platform_driver_register(&sead3_led_driver);
 }
 
 static void __exit sead3_led_exit(void)
 {
-	platform_device_unregister(pdev);
 	platform_driver_unregister(&sead3_led_driver);
 }
 
diff --git a/arch/mips/mti-sead3/sead3-leds.c b/arch/mips/mti-sead3/sead3-leds.c
index c427c57..c6fa3e4 100644
--- a/arch/mips/mti-sead3/sead3-leds.c
+++ b/arch/mips/mti-sead3/sead3-leds.c
@@ -70,10 +70,20 @@ static struct platform_device fled_device = {
 	.resource		= fled_resources
 };
 
-static int __init led_init(void)
+static struct platform_device sead3_led_device = {
+        .name   = "sead3-led",
+        .id     = -1,
+};
+
+struct platform_device *sead3_led_devices[] = {
+	&pled_device,
+	&fled_device,
+	&sead3_led_device,
+};
+
+static int __init sead3_led_init(void)
 {
-	platform_device_register(&pled_device);
-	return platform_device_register(&fled_device);
+	return platform_add_devices(sead3_led_devices, ARRAY_SIZE(sead3_led_devices));
 }
 
-device_initcall(led_init);
+device_initcall(sead3_led_init);
-- 
1.9.3

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

* [PATCH 3/3] LED/MIPS: Move SEAD3 LED driver to where it belongs.
       [not found] <20141023235416.GA7529@linux-mips.org>
  2014-10-23 22:41 ` [PATCH 1/3] MIPS: SEAD3: Fix LED device registration Ralf Baechle
  2014-10-23 23:32 ` [PATCH 2/3] MIPS: SEAD3: Collect LED platform device registration in a single file Ralf Baechle
@ 2014-10-23 23:50 ` Ralf Baechle
  2014-10-24 23:19   ` Bryan Wu
  2 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2014-10-23 23:50 UTC (permalink / raw)
  To: Markos Chandras, linux-mips, Bryan Wu, Richard Purdie, linux-leds

Fixes the following randconfig problem

leds-sead3.c:(.text+0x7dc): undefined reference to `led_classdev_unregister'
leds-sead3.c:(.text+0x7e8): undefined reference to `led_classdev_unregister'

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
 arch/mips/mti-sead3/Makefile     |  2 +-
 arch/mips/mti-sead3/leds-sead3.c | 90 ----------------------------------------
 drivers/leds/Kconfig             |  9 ++++
 drivers/leds/Makefile            |  1 +
 drivers/leds/leds-sead3.c        | 90 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 101 insertions(+), 91 deletions(-)
 delete mode 100644 arch/mips/mti-sead3/leds-sead3.c
 create mode 100644 drivers/leds/leds-sead3.c

diff --git a/arch/mips/mti-sead3/Makefile b/arch/mips/mti-sead3/Makefile
index febf433..aa8a857 100644
--- a/arch/mips/mti-sead3/Makefile
+++ b/arch/mips/mti-sead3/Makefile
@@ -15,7 +15,7 @@ obj-y				:= sead3-lcd.o sead3-display.o sead3-init.o \
 
 obj-y				+= sead3-i2c-dev.o sead3-i2c.o \
 				   sead3-pic32-i2c-drv.o sead3-pic32-bus.o \
-				   leds-sead3.o sead3-leds.o
+				   sead3-leds.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= sead3-console.o
 obj-$(CONFIG_USB_EHCI_HCD)	+= sead3-ehci.o
diff --git a/arch/mips/mti-sead3/leds-sead3.c b/arch/mips/mti-sead3/leds-sead3.c
deleted file mode 100644
index e5632e6..0000000
--- a/arch/mips/mti-sead3/leds-sead3.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/leds.h>
-#include <linux/err.h>
-#include <linux/io.h>
-
-#define DRVNAME "sead3-led"
-
-static void sead3_pled_set(struct led_classdev *led_cdev,
-		enum led_brightness value)
-{
-	pr_debug("sead3_pled_set\n");
-	writel(value, (void __iomem *)0xBF000210);	/* FIXME */
-}
-
-static void sead3_fled_set(struct led_classdev *led_cdev,
-		enum led_brightness value)
-{
-	pr_debug("sead3_fled_set\n");
-	writel(value, (void __iomem *)0xBF000218);	/* FIXME */
-}
-
-static struct led_classdev sead3_pled = {
-	.name		= "sead3::pled",
-	.brightness_set = sead3_pled_set,
-	.flags		= LED_CORE_SUSPENDRESUME,
-};
-
-static struct led_classdev sead3_fled = {
-	.name		= "sead3::fled",
-	.brightness_set = sead3_fled_set,
-	.flags		= LED_CORE_SUSPENDRESUME,
-};
-
-static int sead3_led_probe(struct platform_device *pdev)
-{
-	int ret;
-
-	ret = led_classdev_register(&pdev->dev, &sead3_pled);
-	if (ret < 0)
-		return ret;
-
-	ret = led_classdev_register(&pdev->dev, &sead3_fled);
-	if (ret < 0)
-		led_classdev_unregister(&sead3_pled);
-
-	return ret;
-}
-
-static int sead3_led_remove(struct platform_device *pdev)
-{
-	led_classdev_unregister(&sead3_pled);
-	led_classdev_unregister(&sead3_fled);
-	return 0;
-}
-
-static struct platform_driver sead3_led_driver = {
-	.probe		= sead3_led_probe,
-	.remove		= sead3_led_remove,
-	.driver		= {
-		.name		= DRVNAME,
-		.owner		= THIS_MODULE,
-	},
-};
-
-static int __init sead3_led_init(void)
-{
-	return platform_driver_register(&sead3_led_driver);
-}
-
-static void __exit sead3_led_exit(void)
-{
-	platform_driver_unregister(&sead3_led_driver);
-}
-
-module_init(sead3_led_init);
-module_exit(sead3_led_exit);
-
-MODULE_AUTHOR("Kristian Kielhofner <kris@krisk.org>");
-MODULE_DESCRIPTION("SEAD3 LED driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index a210338..b86aa85 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -477,6 +477,15 @@ config LEDS_MENF21BMC
 	  This driver can also be built as a module. If so the module
 	  will be called leds-menf21bmc.
 
+config LEDS_SEAD3
+	tristate "LED support for the MIPS SEAD 3 board"
+	depends on LEDS_CLASS && MIPS_SEAD3
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC LEDs.
+
+	  This driver can also be built as a module. If so the module
+	  will be called leds-sead3.
+
 comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
 
 config LEDS_BLINKM
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index a2b1647..4f22241 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -56,6 +56,7 @@ obj-$(CONFIG_LEDS_BLINKM)		+= leds-blinkm.o
 obj-$(CONFIG_LEDS_SYSCON)		+= leds-syscon.o
 obj-$(CONFIG_LEDS_VERSATILE)		+= leds-versatile.o
 obj-$(CONFIG_LEDS_MENF21BMC)		+= leds-menf21bmc.o
+obj-$(CONFIG_LEDS_SEAD3)		+= leds-sead3.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)		+= leds-dac124s085.o
diff --git a/drivers/leds/leds-sead3.c b/drivers/leds/leds-sead3.c
new file mode 100644
index 0000000..0cf79f5
--- /dev/null
+++ b/drivers/leds/leds-sead3.c
@@ -0,0 +1,90 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <linux/err.h>
+#include <linux/io.h>
+
+static void sead3_pled_set(struct led_classdev *led_cdev,
+		enum led_brightness value)
+{
+	pr_debug("sead3_pled_set\n");
+	writel(value, (void __iomem *)0xBF000210);	/* FIXME */
+}
+
+static void sead3_fled_set(struct led_classdev *led_cdev,
+		enum led_brightness value)
+{
+	pr_debug("sead3_fled_set\n");
+	writel(value, (void __iomem *)0xBF000218);	/* FIXME */
+}
+
+static struct led_classdev sead3_pled = {
+	.name		= "sead3::pled",
+	.brightness_set = sead3_pled_set,
+	.flags		= LED_CORE_SUSPENDRESUME,
+};
+
+static struct led_classdev sead3_fled = {
+	.name		= "sead3::fled",
+	.brightness_set = sead3_fled_set,
+	.flags		= LED_CORE_SUSPENDRESUME,
+};
+
+static int sead3_led_probe(struct platform_device *pdev)
+{
+	int ret;
+
+	ret = led_classdev_register(&pdev->dev, &sead3_pled);
+	if (ret < 0)
+		return ret;
+
+	ret = led_classdev_register(&pdev->dev, &sead3_fled);
+	if (ret < 0)
+		led_classdev_unregister(&sead3_pled);
+
+	return ret;
+}
+
+static int sead3_led_remove(struct platform_device *pdev)
+{
+	led_classdev_unregister(&sead3_pled);
+	led_classdev_unregister(&sead3_fled);
+
+	return 0;
+}
+
+static struct platform_driver sead3_led_driver = {
+	.probe		= sead3_led_probe,
+	.remove		= sead3_led_remove,
+	.driver		= {
+		.name		= "sead3-led",
+		.owner		= THIS_MODULE,
+	},
+};
+
+static int __init sead3_led_init(void)
+{
+	return platform_driver_register(&sead3_led_driver);
+}
+
+static void __exit sead3_led_exit(void)
+{
+	platform_driver_unregister(&sead3_led_driver);
+}
+
+module_init(sead3_led_init);
+module_exit(sead3_led_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SEAD3 LED driver");
+MODULE_AUTHOR("Kristian Kielhofner <kris@krisk.org>");
+MODULE_ALIAS("platform:sead3-led");
-- 
1.9.3

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

* Re: [PATCH 3/3] LED/MIPS: Move SEAD3 LED driver to where it belongs.
  2014-10-23 23:50 ` [PATCH 3/3] LED/MIPS: Move SEAD3 LED driver to where it belongs Ralf Baechle
@ 2014-10-24 23:19   ` Bryan Wu
  0 siblings, 0 replies; 4+ messages in thread
From: Bryan Wu @ 2014-10-24 23:19 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Markos Chandras, linux-mips, Richard Purdie, Linux LED Subsystem

On Thu, Oct 23, 2014 at 4:50 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> Fixes the following randconfig problem
>
> leds-sead3.c:(.text+0x7dc): undefined reference to `led_classdev_unregister'
> leds-sead3.c:(.text+0x7e8): undefined reference to `led_classdev_unregister'
>

I think you can fold these 3 patches into one patch then.

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> ---
>  arch/mips/mti-sead3/Makefile     |  2 +-
>  arch/mips/mti-sead3/leds-sead3.c | 90 ----------------------------------------
>  drivers/leds/Kconfig             |  9 ++++
>  drivers/leds/Makefile            |  1 +
>  drivers/leds/leds-sead3.c        | 90 ++++++++++++++++++++++++++++++++++++++++
>  5 files changed, 101 insertions(+), 91 deletions(-)
>  delete mode 100644 arch/mips/mti-sead3/leds-sead3.c
>  create mode 100644 drivers/leds/leds-sead3.c
>
> diff --git a/arch/mips/mti-sead3/Makefile b/arch/mips/mti-sead3/Makefile
> index febf433..aa8a857 100644
> --- a/arch/mips/mti-sead3/Makefile
> +++ b/arch/mips/mti-sead3/Makefile
> @@ -15,7 +15,7 @@ obj-y                         := sead3-lcd.o sead3-display.o sead3-init.o \
>
>  obj-y                          += sead3-i2c-dev.o sead3-i2c.o \
>                                    sead3-pic32-i2c-drv.o sead3-pic32-bus.o \
> -                                  leds-sead3.o sead3-leds.o
> +                                  sead3-leds.o
>
>  obj-$(CONFIG_EARLY_PRINTK)     += sead3-console.o
>  obj-$(CONFIG_USB_EHCI_HCD)     += sead3-ehci.o
> diff --git a/arch/mips/mti-sead3/leds-sead3.c b/arch/mips/mti-sead3/leds-sead3.c
> deleted file mode 100644
> index e5632e6..0000000
> --- a/arch/mips/mti-sead3/leds-sead3.c
> +++ /dev/null
> @@ -1,90 +0,0 @@
> -/*
> - * This file is subject to the terms and conditions of the GNU General Public
> - * License.  See the file "COPYING" in the main directory of this archive
> - * for more details.
> - *
> - * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
> - */
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/init.h>
> -#include <linux/platform_device.h>
> -#include <linux/leds.h>
> -#include <linux/err.h>
> -#include <linux/io.h>
> -
> -#define DRVNAME "sead3-led"
> -
> -static void sead3_pled_set(struct led_classdev *led_cdev,
> -               enum led_brightness value)
> -{
> -       pr_debug("sead3_pled_set\n");
> -       writel(value, (void __iomem *)0xBF000210);      /* FIXME */
> -}
> -
> -static void sead3_fled_set(struct led_classdev *led_cdev,
> -               enum led_brightness value)
> -{
> -       pr_debug("sead3_fled_set\n");
> -       writel(value, (void __iomem *)0xBF000218);      /* FIXME */
> -}
> -
> -static struct led_classdev sead3_pled = {
> -       .name           = "sead3::pled",
> -       .brightness_set = sead3_pled_set,
> -       .flags          = LED_CORE_SUSPENDRESUME,
> -};
> -
> -static struct led_classdev sead3_fled = {
> -       .name           = "sead3::fled",
> -       .brightness_set = sead3_fled_set,
> -       .flags          = LED_CORE_SUSPENDRESUME,
> -};
> -
> -static int sead3_led_probe(struct platform_device *pdev)
> -{
> -       int ret;
> -
> -       ret = led_classdev_register(&pdev->dev, &sead3_pled);
> -       if (ret < 0)
> -               return ret;
> -
> -       ret = led_classdev_register(&pdev->dev, &sead3_fled);
> -       if (ret < 0)
> -               led_classdev_unregister(&sead3_pled);
> -
> -       return ret;
> -}
> -
> -static int sead3_led_remove(struct platform_device *pdev)
> -{
> -       led_classdev_unregister(&sead3_pled);
> -       led_classdev_unregister(&sead3_fled);
> -       return 0;
> -}
> -
> -static struct platform_driver sead3_led_driver = {
> -       .probe          = sead3_led_probe,
> -       .remove         = sead3_led_remove,
> -       .driver         = {
> -               .name           = DRVNAME,
> -               .owner          = THIS_MODULE,
> -       },
> -};
> -
> -static int __init sead3_led_init(void)
> -{
> -       return platform_driver_register(&sead3_led_driver);
> -}
> -
> -static void __exit sead3_led_exit(void)
> -{
> -       platform_driver_unregister(&sead3_led_driver);
> -}
> -
> -module_init(sead3_led_init);
> -module_exit(sead3_led_exit);
> -
> -MODULE_AUTHOR("Kristian Kielhofner <kris@krisk.org>");
> -MODULE_DESCRIPTION("SEAD3 LED driver");
> -MODULE_LICENSE("GPL");
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index a210338..b86aa85 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -477,6 +477,15 @@ config LEDS_MENF21BMC
>           This driver can also be built as a module. If so the module
>           will be called leds-menf21bmc.
>
> +config LEDS_SEAD3
> +       tristate "LED support for the MIPS SEAD 3 board"
> +       depends on LEDS_CLASS && MIPS_SEAD3
> +       help
> +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> +

Is this driver similar to drivers/leds/leds-menf21bmc.c? If we can
reuse the code it should be better.

> +         This driver can also be built as a module. If so the module
> +         will be called leds-sead3.
> +
>  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
>
>  config LEDS_BLINKM
> diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> index a2b1647..4f22241 100644
> --- a/drivers/leds/Makefile
> +++ b/drivers/leds/Makefile
> @@ -56,6 +56,7 @@ obj-$(CONFIG_LEDS_BLINKM)             += leds-blinkm.o
>  obj-$(CONFIG_LEDS_SYSCON)              += leds-syscon.o
>  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
>  obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
> +obj-$(CONFIG_LEDS_SEAD3)               += leds-sead3.o
>
>  # LED SPI Drivers
>  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> diff --git a/drivers/leds/leds-sead3.c b/drivers/leds/leds-sead3.c
> new file mode 100644
> index 0000000..0cf79f5
> --- /dev/null
> +++ b/drivers/leds/leds-sead3.c
> @@ -0,0 +1,90 @@
> +/*
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2012 MIPS Technologies, Inc.  All rights reserved.
> + */
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/leds.h>
> +#include <linux/err.h>
> +#include <linux/io.h>
> +

Please reorder this list in alphabetic order.

> +static void sead3_pled_set(struct led_classdev *led_cdev,
> +               enum led_brightness value)
> +{
> +       pr_debug("sead3_pled_set\n");

Don't use pr_debug, please use dev_dbg();

> +       writel(value, (void __iomem *)0xBF000210);      /* FIXME */

Fix this, define some meaningful name of the address.

> +}
> +
> +static void sead3_fled_set(struct led_classdev *led_cdev,
> +               enum led_brightness value)
> +{
> +       pr_debug("sead3_fled_set\n");
Don't use pr_debug, please use dev_dbg();

> +       writel(value, (void __iomem *)0xBF000218);      /* FIXME */

ditto

> +}
> +
> +static struct led_classdev sead3_pled = {
> +       .name           = "sead3::pled",
> +       .brightness_set = sead3_pled_set,
> +       .flags          = LED_CORE_SUSPENDRESUME,
> +};
> +
> +static struct led_classdev sead3_fled = {
> +       .name           = "sead3::fled",
> +       .brightness_set = sead3_fled_set,
> +       .flags          = LED_CORE_SUSPENDRESUME,
> +};
> +

What's pled and fled? Please give more meaningful name or document it.

> +static int sead3_led_probe(struct platform_device *pdev)
> +{
> +       int ret;
> +
> +       ret = led_classdev_register(&pdev->dev, &sead3_pled);
> +       if (ret < 0)
> +               return ret;
> +
> +       ret = led_classdev_register(&pdev->dev, &sead3_fled);
> +       if (ret < 0)
> +               led_classdev_unregister(&sead3_pled);
> +
> +       return ret;
> +}
> +
> +static int sead3_led_remove(struct platform_device *pdev)
> +{
> +       led_classdev_unregister(&sead3_pled);
> +       led_classdev_unregister(&sead3_fled);
> +
> +       return 0;
> +}
> +
> +static struct platform_driver sead3_led_driver = {
> +       .probe          = sead3_led_probe,
> +       .remove         = sead3_led_remove,
> +       .driver         = {
> +               .name           = "sead3-led",
> +               .owner          = THIS_MODULE,
> +       },
> +};
> +
> +static int __init sead3_led_init(void)
> +{
> +       return platform_driver_register(&sead3_led_driver);
> +}
> +
> +static void __exit sead3_led_exit(void)
> +{
> +       platform_driver_unregister(&sead3_led_driver);
> +}
> +
> +module_init(sead3_led_init);
> +module_exit(sead3_led_exit);
> +

You can use module_platform_driver() here.

> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("SEAD3 LED driver");
> +MODULE_AUTHOR("Kristian Kielhofner <kris@krisk.org>");
> +MODULE_ALIAS("platform:sead3-led");
> --
> 1.9.3
>

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

end of thread, other threads:[~2014-10-24 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20141023235416.GA7529@linux-mips.org>
2014-10-23 22:41 ` [PATCH 1/3] MIPS: SEAD3: Fix LED device registration Ralf Baechle
2014-10-23 23:32 ` [PATCH 2/3] MIPS: SEAD3: Collect LED platform device registration in a single file Ralf Baechle
2014-10-23 23:50 ` [PATCH 3/3] LED/MIPS: Move SEAD3 LED driver to where it belongs Ralf Baechle
2014-10-24 23:19   ` Bryan Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).