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

Andy Whitcroft apw at canonical.com
Thu Mar 13 10:25:49 UTC 2014


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 at canonical.com>
> Signed-off-by: Bryan Wu <cooloney at 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 at 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




More information about the kernel-team mailing list