diff mbox

[1/2] leds-gpio: of: introduce MODULE_DEVICE_TABLE for module autoloading

Message ID 1394559431-15279-2-git-send-email-paolo.pisati@canonical.com
State New
Headers show

Commit Message

Paolo Pisati March 11, 2014, 5:37 p.m. UTC
Enable autoloading of leds-gpio module when a corresponing DT entry is present.

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
(cherry picked from commit 72b854bbc0b55de850faa802250fc1aa7692e45 at
git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds.git fox-next)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 drivers/leds/leds-gpio.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Whitcroft March 13, 2014, 10:25 a.m. UTC | #1
On Tue, Mar 11, 2014 at 06:37:10PM +0100, Paolo Pisati wrote:
> Enable autoloading of leds-gpio module when a corresponing DT entry is present.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> Signed-off-by: Bryan Wu <cooloney@gmail.com>
> (cherry picked from commit 72b854bbc0b55de850faa802250fc1aa7692e45 at
> git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds.git fox-next)
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  drivers/leds/leds-gpio.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 78b0e27..653d501 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -224,6 +224,8 @@ static const struct of_device_id of_gpio_leds_match[] = {
>  	{ .compatible = "gpio-leds", },
>  	{},
>  };
> +
> +MODULE_DEVICE_TABLE(of, of_gpio_leds_match);
>  #else /* CONFIG_OF_GPIO */
>  static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
>  {

I think this looks reasonable, though probabally this is a case where
only arm needs this builtin so we are probabally better not pulling it
so on the others (the config change).

-apw
diff mbox

Patch

diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 78b0e27..653d501 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -224,6 +224,8 @@  static const struct of_device_id of_gpio_leds_match[] = {
 	{ .compatible = "gpio-leds", },
 	{},
 };
+
+MODULE_DEVICE_TABLE(of, of_gpio_leds_match);
 #else /* CONFIG_OF_GPIO */
 static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
 {