]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
leds: lp3952: Export I2C module alias information for module autoload
authorJavier Martinez Canillas <javier@osg.samsung.com>
Fri, 14 Oct 2016 12:23:34 +0000 (09:23 -0300)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Tue, 22 Nov 2016 11:07:03 +0000 (12:07 +0100)
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>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
drivers/leds/leds-lp3952.c

index a73c8ff085302a6f196521f863d9ef203ee0b7e4..4847e89883a761f152794c8156cc990b2e23ee2e 100644 (file)
@@ -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[] = {