diff mbox

[RESEND,1/7] i2c: core: Export I2C module alias information in dummy driver

Message ID 1440484277-32675-2-git-send-email-javier@osg.samsung.com
State Rejected
Headers show

Commit Message

Javier Martinez Canillas Aug. 25, 2015, 6:31 a.m. UTC
The I2C core always reports the MODALIAS uevent as "i2c:<modalias>"
regardless of the mechanism that was used to register the device
(i.e: OF or board code) and the table that is used later to match
the driver with the device (i.e: I2C id table or OF match table).

So drivers needs to export the I2C id table and this be built into
the module or udev won't have the necessary information to autoload
the needed driver module when the device is added.

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

---

 drivers/i2c/i2c-core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Wolfram Sang Aug. 26, 2015, 4:55 p.m. UTC | #1
On Tue, Aug 25, 2015 at 08:31:11AM +0200, Javier Martinez Canillas wrote:
> The I2C core always reports the MODALIAS uevent as "i2c:<modalias>"
> regardless of the mechanism that was used to register the device
> (i.e: OF or board code) and the table that is used later to match
> the driver with the device (i.e: I2C id table or OF match table).
> 
> So drivers needs to export the I2C id table and this be built into
> the module or udev won't have the necessary information to autoload
> the needed driver module when the device is added.
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

The dummy driver is always loaded when the i2c core inits.
Javier Martinez Canillas Aug. 26, 2015, 6:09 p.m. UTC | #2
Hello Wolfram,

On 08/26/2015 06:55 PM, Wolfram Sang wrote:
> On Tue, Aug 25, 2015 at 08:31:11AM +0200, Javier Martinez Canillas wrote:
>> The I2C core always reports the MODALIAS uevent as "i2c:<modalias>"
>> regardless of the mechanism that was used to register the device
>> (i.e: OF or board code) and the table that is used later to match
>> the driver with the device (i.e: I2C id table or OF match table).
>>
>> So drivers needs to export the I2C id table and this be built into
>> the module or udev won't have the necessary information to autoload
>> the needed driver module when the device is added.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> The dummy driver is always loaded when the i2c core inits.
> 

Ok, I wondered if that was the case but I
was not sure so I posted it just in case.

Then this patch should be dropped.

Best regards,
Wolfram Sang Aug. 31, 2015, 8:31 p.m. UTC | #3
> > The dummy driver is always loaded when the i2c core inits.
> > 
> 
> Ok, I wondered if that was the case but I
> was not sure so I posted it just in case.

Check the source code, this part is pretty obvious...
Javier Martinez Canillas Aug. 31, 2015, 10:30 p.m. UTC | #4
Hello Wolfram,

On 08/31/2015 10:31 PM, Wolfram Sang wrote:
> 
>>> The dummy driver is always loaded when the i2c core inits.
>>>
>>
>> Ok, I wondered if that was the case but I
>> was not sure so I posted it just in case.
> 
> Check the source code, this part is pretty obvious...
>

Yes, sorry for missing that obvious detail...

Best regards,
Wolfram Sang Aug. 31, 2015, 10:46 p.m. UTC | #5
On Tue, Sep 01, 2015 at 12:30:22AM +0200, Javier Martinez Canillas wrote:
> Hello Wolfram,
> 
> On 08/31/2015 10:31 PM, Wolfram Sang wrote:
> > 
> >>> The dummy driver is always loaded when the i2c core inits.
> >>>
> >>
> >> Ok, I wondered if that was the case but I
> >> was not sure so I posted it just in case.
> > 
> > Check the source code, this part is pretty obvious...
> >
> 
> Yes, sorry for missing that obvious detail...

No problem, now you know :)
diff mbox

Patch

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index a6780289c61d..46536834920c 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1041,6 +1041,7 @@  static const struct i2c_device_id dummy_id[] = {
 	{ "dummy", 0 },
 	{ },
 };
+MODULE_DEVICE_TABLE(i2c, dummy_id);
 
 static int dummy_probe(struct i2c_client *client,
 		       const struct i2c_device_id *id)