]> git.baikalelectronics.ru Git - kernel.git/commit
media: i2c: adv748x: Export I2C device table entries as module aliases
authorJavier Martinez Canillas <javierm@redhat.com>
Wed, 9 Aug 2017 09:37:30 +0000 (05:37 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 27 Aug 2017 22:12:14 +0000 (18:12 -0400)
commit94b835d0b3d95cb9eaf5770885069fecdf731208
treef786bf6a0779383dd71b38ddd95edab31c0c4ac3
parent1144b3a5ee4feb41a8d9e6c03d726f698e1e7529
media: i2c: adv748x: Export I2C device table entries as module aliases

The I2C core always reports a MODALIAS of the form i2c:<foo> even if the
device was registered via OF, and the driver is only exporting the OF ID
table entries as module aliases.

So if the driver is built as module, autoload won't work since udev/kmod
won't be able to match the registered OF device with its driver module.

Before this patch:

$ modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias
alias:          of:N*T*Cadi,adv7482C*
alias:          of:N*T*Cadi,adv7482
alias:          of:N*T*Cadi,adv7481C*
alias:          of:N*T*Cadi,adv7481

After this patch:

modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias
alias:          of:N*T*Cadi,adv7482C*
alias:          of:N*T*Cadi,adv7482
alias:          of:N*T*Cadi,adv7481C*
alias:          of:N*T*Cadi,adv7481
alias:          i2c:adv7482
alias:          i2c:adv7481

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/adv748x/adv748x-core.c