Re: [PATCH v2 2/2] IIO: st_accel_i2c.c: Use probe_new() instead of probe()
From: Javier Martinez Canillas
Date: Wed Jul 04 2018 - 07:32:53 EST
On Wed, Jul 4, 2018 at 1:26 PM, Javier Martinez Canillas
<javier@xxxxxxxxxxxx> wrote:
[snip]
>> Ok, in my opinion it is an elegant way of not bloating the driver when no
>> explicit handling (e.g. reading DT properties) is needed. Just adding an
>> of_device_id doesn't change any driver functionality then but only maps to
>> an already existing i2c_table_id.
>>
>
> I disagree, in the case of OF for example a compatible string is
> composed of both a vendor a device, the complete tuple is what should
> be matched.
>
> But with the fallback, only the device portion would be used so both
> <foo,bar> and <baz,bar> will match against the i2c device with id
> "bar". It may or may not be correct but the vendor portion is very
> important to disambiguate.
>
And having a compatible = "bar" is also wrong since the compatible
string would lack the vendor prefix. The fact that the I2C (and SPI)
core allowed this was what caused the problem in the first place IMO.
Best regards,
Javier