[PATCH] leds: lp3952: Export I2C module alias information for module autoload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---

 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

--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux