Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: do not try to load modules for of-registered devices

Trying to register an I2C device asynchronously (via async_schedule() call)
results in an ugly warning from request_module() warning about potential
deadlock (because request_module tries to wait for async works to
complete). While we could try to switch to request_module_nowait(), other
buses, as well as I2C itself when not using device tree, do not try to load
modules, but rather rely on the standard infrastructure (udev) to execute
module loading, and we should be doing the same.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Dmitry Torokhov and committed by
Wolfram Sang
c680eed5 894acb2f

-2
-2
drivers/i2c/i2c-core.c
··· 1291 1291 if (of_get_property(node, "wakeup-source", NULL)) 1292 1292 info.flags |= I2C_CLIENT_WAKE; 1293 1293 1294 - request_module("%s%s", I2C_MODULE_PREFIX, info.type); 1295 - 1296 1294 result = i2c_new_device(adap, &info); 1297 1295 if (result == NULL) { 1298 1296 dev_err(&adap->dev, "of_i2c: Failure registering %s\n",