linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: lp3952: Export I2C module alias information for module autoload
@ 2016-10-14 12:23 ` Javier Martinez Canillas
  2016-10-14 13:57   ` Jacek Anaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2016-10-14 12:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Jacek Anaszewski, Richard Purdie, linux-leds

If the driver is built as a module, I2C module alias information is not
filled so the module won't be autoloaded if the device isn't registered
over ACPI. Export the I2C device table alias with MODULE_DEVICE_TABLE()
macro so the information is exported in the module.

Before this patch:

$ modinfo drivers/leds/leds-lp3952.ko | grep alias
alias:          acpi*:TXNW3952:*

After this patch:

$ modinfo drivers/leds/leds-lp3952.ko | grep alias
alias:          i2c:lp3952
alias:          acpi*:TXNW3952:*

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/leds/leds-lp3952.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/leds/leds-lp3952.c b/drivers/leds/leds-lp3952.c
index a73c8ff08530..4847e89883a7 100644
--- a/drivers/leds/leds-lp3952.c
+++ b/drivers/leds/leds-lp3952.c
@@ -274,6 +274,7 @@ static const struct i2c_device_id lp3952_id[] = {
 	{LP3952_NAME, 0},
 	{}
 };
+MODULE_DEVICE_TABLE(i2c, lp3952_id);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id lp3952_acpi_match[] = {
-- 
2.7.4

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

* Re: [PATCH] leds: lp3952: Export I2C module alias information for module autoload
  2016-10-14 12:23 ` [PATCH] leds: lp3952: Export I2C module alias information for module autoload Javier Martinez Canillas
@ 2016-10-14 13:57   ` Jacek Anaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2016-10-14 13:57 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel; +Cc: Richard Purdie, linux-leds

Hi Javier,

Thanks for the patch.
Applied to the for-4.10 branch of linux-leds.git.

Best regards,
Jacek Anaszewski

On 10/14/2016 02:23 PM, Javier Martinez Canillas wrote:
> If the driver is built as a module, I2C module alias information is not
> filled so the module won't be autoloaded if the device isn't registered
> over ACPI. Export the I2C device table alias with MODULE_DEVICE_TABLE()
> macro so the information is exported in the module.
>
> Before this patch:
>
> $ modinfo drivers/leds/leds-lp3952.ko | grep alias
> alias:          acpi*:TXNW3952:*
>
> After this patch:
>
> $ modinfo drivers/leds/leds-lp3952.ko | grep alias
> alias:          i2c:lp3952
> alias:          acpi*:TXNW3952:*
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
>
>  drivers/leds/leds-lp3952.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/leds/leds-lp3952.c b/drivers/leds/leds-lp3952.c
> index a73c8ff08530..4847e89883a7 100644
> --- a/drivers/leds/leds-lp3952.c
> +++ b/drivers/leds/leds-lp3952.c
> @@ -274,6 +274,7 @@ static const struct i2c_device_id lp3952_id[] = {
>  	{LP3952_NAME, 0},
>  	{}
>  };
> +MODULE_DEVICE_TABLE(i2c, lp3952_id);
>
>  #ifdef CONFIG_ACPI
>  static const struct acpi_device_id lp3952_acpi_match[] = {
>

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

end of thread, other threads:[~2016-10-14 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20161014122349eucas1p23c6870d6c9b6b729a65f4d94d1e8429a@eucas1p2.samsung.com>
2016-10-14 12:23 ` [PATCH] leds: lp3952: Export I2C module alias information for module autoload Javier Martinez Canillas
2016-10-14 13:57   ` Jacek Anaszewski

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).