On Thu, Aug 03, 2023 at 11:31:00AM +0100, Biju Das wrote: > Add i2c_device_get_match_data() callback to struct bus_type(). > > While at it, introduced i2c_get_match_data_helper() to avoid code > duplication with i2c_get_match_data(). It seems you are missing to Cc Andi for all these... (not your fault, rather unfortunately). Yes, while he is not directly involved into core changes the drivers are pretty much should consider this change. ... > data = device_get_match_data(&client->dev); > - if (!data) { > - match = i2c_match_id(driver->id_table, client); > - if (!match) > - return NULL; > + if (data) > + return data; > > - data = (const void *)match->driver_data; > - } > - > - return data; Looking at this, it _might_ make sense to split another patch to prepare for better difference here. - if (!data) { - match = i2c_match_id(driver->id_table, client); - if (!match) - return NULL; + if (data) + return data; + + match = i2c_match_id(driver->id_table, client); + if (!match) + return NULL; + + return (const void *)match->driver_data; Just play with this idea. -- With Best Regards, Andy Shevchenko