* [folded] leds-provide-helper-to-register-leds-gpio-devices-v4.patch removed from -mm tree
@ 2011-05-25 0:05 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2011-05-25 0:05 UTC (permalink / raw)
To: u.kleine-koenig, fabio.estevam, hartleys, richard.purdie, rmk,
s.hauer, mm-commits
The patch titled
leds-provide-helper-to-register-leds-gpio-devices-v4
has been removed from the -mm tree. Its filename was
leds-provide-helper-to-register-leds-gpio-devices-v4.patch
This patch was dropped because it was folded into leds-provide-helper-to-register-leds-gpio-devices.patch
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: leds-provide-helper-to-register-leds-gpio-devices-v4
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
- new commit log
- improved documentation and moved it to .c file
- used obj-$(CONFIG..) and renamed source file
- provide an example usage (in a seperate patch)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/leds/Kconfig | 4 ++
drivers/leds/Makefile | 2 -
drivers/leds/led-register.c | 33 ----------------------
drivers/leds/leds-gpio-register.c | 42 ++++++++++++++++++++++++++++
include/linux/leds.h | 10 ------
5 files changed, 46 insertions(+), 45 deletions(-)
diff -puN drivers/leds/Kconfig~leds-provide-helper-to-register-leds-gpio-devices-v4 drivers/leds/Kconfig
--- a/drivers/leds/Kconfig~leds-provide-helper-to-register-leds-gpio-devices-v4
+++ a/drivers/leds/Kconfig
@@ -14,10 +14,12 @@ config LEDS_CLASS
This option enables the led sysfs class in /sys/class/leds. You'll
need this to do anything useful with LEDs. If unsure, say N.
-config LEDS_REGISTER_GPIO
+config LEDS_GPIO_REGISTER
bool
help
This option provides the function gpio_led_register_device.
+ As this function is used by arch code it must not be compiled as a
+ module.
if NEW_LEDS
diff -puN drivers/leds/Makefile~leds-provide-helper-to-register-leds-gpio-devices-v4 drivers/leds/Makefile
--- a/drivers/leds/Makefile~leds-provide-helper-to-register-leds-gpio-devices-v4
+++ a/drivers/leds/Makefile
@@ -3,7 +3,6 @@
obj-$(CONFIG_NEW_LEDS) += led-core.o
obj-$(CONFIG_LEDS_CLASS) += led-class.o
obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o
-obj-y += led-register.o
# LED Platform Drivers
obj-$(CONFIG_LEDS_88PM860X) += leds-88pm860x.o
@@ -21,6 +20,7 @@ obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-
obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunfire.o
obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o
+obj-$(CONFIG_LEDS_GPIO_REGISTER) += leds-gpio-register.o
obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o
obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o
obj-$(CONFIG_LEDS_LP5521) += leds-lp5521.o
diff -puN drivers/leds/led-register.c~leds-provide-helper-to-register-leds-gpio-devices-v4 /dev/null
--- a/drivers/leds/led-register.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011 Pengutronix
- * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License version 2 as published by the
- * Free Software Foundation.
- */
-#include <linux/err.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/leds.h>
-
-#if defined(CONFIG_LEDS_REGISTER_GPIO)
-struct platform_device *__init gpio_led_register_device(
- int id, const struct gpio_led_platform_data *pdata)
-{
- struct platform_device *ret;
- struct gpio_led_platform_data _pdata = *pdata;
-
- _pdata.leds = kmemdup(pdata->leds,
- pdata->num_leds * sizeof(*pdata->leds), GFP_KERNEL);
- if (!_pdata.leds)
- return ERR_PTR(-ENOMEM);
-
- ret = platform_device_register_resndata(NULL, "leds-gpio", id,
- NULL, 0, &_pdata, sizeof(_pdata));
- if (IS_ERR(ret))
- kfree(_pdata.leds);
-
- return ret;
-}
-#endif
diff -puN /dev/null drivers/leds/leds-gpio-register.c
--- /dev/null
+++ a/drivers/leds/leds-gpio-register.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011 Pengutronix
+ * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/leds.h>
+
+/**
+ * gpio_led_register_device - register a gpio-led device
+ * @pdata: the platform data used for the new device
+ *
+ * Makes a copy of pdata and pdata->leds and registers a new leds-gpio device
+ * with the result. This allows to have pdata and pdata-leds in .init.rodata
+ * and so saves some bytes compared to a static struct platform_device with
+ * static platform data.
+ *
+ * Returns the registered device or an error pointer.
+ */
+struct platform_device *__init gpio_led_register_device(
+ int id, const struct gpio_led_platform_data *pdata)
+{
+ struct platform_device *ret;
+ struct gpio_led_platform_data _pdata = *pdata;
+
+ _pdata.leds = kmemdup(pdata->leds,
+ pdata->num_leds * sizeof(*pdata->leds), GFP_KERNEL);
+ if (!_pdata.leds)
+ return ERR_PTR(-ENOMEM);
+
+ ret = platform_device_register_resndata(NULL, "leds-gpio", id,
+ NULL, 0, &_pdata, sizeof(_pdata));
+ if (IS_ERR(ret))
+ kfree(_pdata.leds);
+
+ return ret;
+}
diff -puN include/linux/leds.h~leds-provide-helper-to-register-leds-gpio-devices-v4 include/linux/leds.h
--- a/include/linux/leds.h~leds-provide-helper-to-register-leds-gpio-devices-v4
+++ a/include/linux/leds.h
@@ -207,16 +207,6 @@ struct gpio_led_platform_data {
unsigned long *delay_off);
};
-/**
- * gpio_led_register_device - register a gpio-led device
- * @pdata: the platform data used for the new device
- *
- * Use this function instead of platform_device_add()ing a static struct
- * platform_device.
- *
- * Note: as pdata and pdata->leds is copied these usually can and should be
- * __initdata.
- */
struct platform_device *gpio_led_register_device(
int id, const struct gpio_led_platform_data *pdata);
_
Patches currently in -mm which might be from u.kleine-koenig@pengutronix.de are
origin.patch
leds-provide-helper-to-register-leds-gpio-devices.patch
--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-25 0:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-25 0:05 [folded] leds-provide-helper-to-register-leds-gpio-devices-v4.patch removed from -mm tree akpm
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).