i2c possible patch

Nuno Sá noname.nuno at gmail.com
Wed Jul 22 06:49:05 EDT 2020


Hi all,

I was looking at the i2c core code and I stumbled in a condition that
looks like some "legacy" thing. While I'm not sure about this, this
mailing list feels like a good place to get some feedback. The
condition in question is this

https://elixir.bootlin.com/linux/latest/source/drivers/i2c/i2c-core-base.c#L356

So, my first question is: Can we actually get into `i2c_device_probe()`
without `i2c_device_match()` being called first? If not, it looks that
this condition could just be removed...

If we can get there without `i2c_device_match()`, I can see a problem
in the condition if we just use of_id_table in ACPI.
`i2c_acpi_match_device()` just calls `acpi_match_device()` whereas I
think `acpi_driver_match_device()` should be used if we want to take
of_id_table into account. Does this really look like an issue or Am I
missing something?


- Nuno Sá




More information about the Kernelnewbies mailing list