On Mon, Aug 12, 2024 at 06:00:20PM +0200, Hans de Goede wrote: > On 8/5/24 10:48 PM, Andy Shevchenko wrote: > > On Mon, Aug 5, 2024 at 3:38 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: ... > >> + bus_for_each_dev(&i2c_bus_type, NULL, &adap, find_i801); > >> + if (!adap) > >> + return; > > > > May i2c_for_each_dev() be used here? > > The main difference between i2c_for_each_dev() and > bus_for_each_dev() is that i2c_for_each_dev() holds > the i2c core mutex while it is calling the passed > in callback. > > And find_i801() calls i2c_get_adapter() which also > takes the i2c core mutex, so i2c_for_each_dev() > cannot be used here since then things deadlock. + A comment to prevent "clever" cleanupers from breaking the things? -- With Best Regards, Andy Shevchenko