* [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases
@ 2017-08-09 9:37 Javier Martinez Canillas
2017-08-09 10:29 ` Kieran Bingham
0 siblings, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2017-08-09 9:37 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, Kieran Bingham, Mauro Carvalho Chehab,
linux-media
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>
---
drivers/media/i2c/adv748x/adv748x-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index aeb6ae80cb18..5ee14f2c2747 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -807,6 +807,7 @@ static const struct i2c_device_id adv748x_id[] = {
{ "adv7482", 0 },
{ },
};
+MODULE_DEVICE_TABLE(i2c, adv748x_id);
static const struct of_device_id adv748x_of_table[] = {
{ .compatible = "adi,adv7481", },
--
2.13.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases
2017-08-09 9:37 [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases Javier Martinez Canillas
@ 2017-08-09 10:29 ` Kieran Bingham
2017-08-09 10:58 ` Javier Martinez Canillas
0 siblings, 1 reply; 5+ messages in thread
From: Kieran Bingham @ 2017-08-09 10:29 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: Mauro Carvalho Chehab, linux-media
Hi Javier,
Thankyou for the patch
On 09/08/17 10:37, Javier Martinez Canillas wrote:
> 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.
Good catch, and perhaps I should have known better :D
I've only worked on this driver as a built-in so far :-) #BadExcuses
> 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>
> ---
>
> drivers/media/i2c/adv748x/adv748x-core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
> index aeb6ae80cb18..5ee14f2c2747 100644
> --- a/drivers/media/i2c/adv748x/adv748x-core.c
> +++ b/drivers/media/i2c/adv748x/adv748x-core.c
> @@ -807,6 +807,7 @@ static const struct i2c_device_id adv748x_id[] = {
> { "adv7482", 0 },
> { },
> };
> +MODULE_DEVICE_TABLE(i2c, adv748x_id);
>
> static const struct of_device_id adv748x_of_table[] = {
> { .compatible = "adi,adv7481", },
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases
2017-08-09 10:29 ` Kieran Bingham
@ 2017-08-09 10:58 ` Javier Martinez Canillas
2017-08-09 11:05 ` Kieran Bingham
0 siblings, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2017-08-09 10:58 UTC (permalink / raw)
To: Kieran Bingham, linux-kernel; +Cc: Mauro Carvalho Chehab, linux-media
Hi Kieran,
On 08/09/2017 12:29 PM, Kieran Bingham wrote:
> Hi Javier,
>
> Thankyou for the patch
>
You are welcome.
> On 09/08/17 10:37, Javier Martinez Canillas wrote:
>> 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.
>
> Good catch, and perhaps I should have known better :D
>
> I've only worked on this driver as a built-in so far :-) #BadExcuses
>
A better excuse I think is that after all these years, one would had thought
that the I2C OF modalias issue would had been finally fixed, but not yet :)
>> 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>
>
Thanks!
Best regards,
--
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases
2017-08-09 10:58 ` Javier Martinez Canillas
@ 2017-08-09 11:05 ` Kieran Bingham
2017-08-09 11:16 ` Javier Martinez Canillas
0 siblings, 1 reply; 5+ messages in thread
From: Kieran Bingham @ 2017-08-09 11:05 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: Mauro Carvalho Chehab, linux-media
On 09/08/17 11:58, Javier Martinez Canillas wrote:
> Hi Kieran,
>
> On 08/09/2017 12:29 PM, Kieran Bingham wrote:
>> Hi Javier,
>>
>> Thankyou for the patch
>
> You are welcome.
>
>> On 09/08/17 10:37, Javier Martinez Canillas wrote:
>>> 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.
>>
>> Good catch, and perhaps I should have known better :D
>>
>> I've only worked on this driver as a built-in so far :-) #BadExcuses
>>
>
> A better excuse I think is that after all these years, one would had thought
> that the I2C OF modalias issue would had been finally fixed, but not yet :)
Quite! Let's try to bubble that back up the todo list.
Now - where did I put my free time. I'm sure I left it around here somewhere :-)
--
Kieran
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases
2017-08-09 11:05 ` Kieran Bingham
@ 2017-08-09 11:16 ` Javier Martinez Canillas
0 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2017-08-09 11:16 UTC (permalink / raw)
To: Kieran Bingham, linux-kernel
Cc: Mauro Carvalho Chehab, linux-media, Wolfram Sang
On 08/09/2017 01:05 PM, Kieran Bingham wrote:
> On 09/08/17 11:58, Javier Martinez Canillas wrote:
>> Hi Kieran,
>>
>> On 08/09/2017 12:29 PM, Kieran Bingham wrote:
>>> Hi Javier,
>>>
>>> Thankyou for the patch
>>
>> You are welcome.
>>
>>> On 09/08/17 10:37, Javier Martinez Canillas wrote:
>>>> 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.
>>>
>>> Good catch, and perhaps I should have known better :D
>>>
>>> I've only worked on this driver as a built-in so far :-) #BadExcuses
>>>
>>
>> A better excuse I think is that after all these years, one would had thought
>> that the I2C OF modalias issue would had been finally fixed, but not yet :)
>
> Quite! Let's try to bubble that back up the todo list.
> Now - where did I put my free time. I'm sure I left it around here somewhere :-)
>
We are getting there though. I'm just waiting for the patches in this [0] series
to land and then I'll be able to post the I2C core uevent modalias patch.
I've asked Wolfram if he can at least pick the driver patches [1], but he didn't
answer me yet...
[0]: https://www.spinics.net/lists/arm-kernel/msg588431.html
[1]: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1457427.html
Best regards,
--
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-09 11:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 9:37 [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases Javier Martinez Canillas
2017-08-09 10:29 ` Kieran Bingham
2017-08-09 10:58 ` Javier Martinez Canillas
2017-08-09 11:05 ` Kieran Bingham
2017-08-09 11:16 ` Javier Martinez Canillas
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).