Commit e693810c authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

hwmon: Let w83781d and lm78 load again

Let the w83781d and lm78 hardware monitoring drivers load even when
no chip was detected at the ISA address. There can still be supported
chips connected to an I2C bus or SMBus.

This fixes bug #7293.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 14992c7e
...@@ -815,18 +815,18 @@ static int __init sm_lm78_init(void) ...@@ -815,18 +815,18 @@ static int __init sm_lm78_init(void)
if (res) if (res)
return res; return res;
res = i2c_isa_add_driver(&lm78_isa_driver); /* Don't exit if this one fails, we still want the I2C variants
if (res) { to work! */
i2c_del_driver(&lm78_driver); if (i2c_isa_add_driver(&lm78_isa_driver))
return res; isa_address = 0;
}
return 0; return 0;
} }
static void __exit sm_lm78_exit(void) static void __exit sm_lm78_exit(void)
{ {
i2c_isa_del_driver(&lm78_isa_driver); if (isa_address)
i2c_isa_del_driver(&lm78_isa_driver);
i2c_del_driver(&lm78_driver); i2c_del_driver(&lm78_driver);
} }
......
...@@ -1685,11 +1685,10 @@ sensors_w83781d_init(void) ...@@ -1685,11 +1685,10 @@ sensors_w83781d_init(void)
if (res) if (res)
return res; return res;
res = i2c_isa_add_driver(&w83781d_isa_driver); /* Don't exit if this one fails, we still want the I2C variants
if (res) { to work! */
i2c_del_driver(&w83781d_driver); if (i2c_isa_add_driver(&w83781d_isa_driver))
return res; isa_address = 0;
}
return 0; return 0;
} }
...@@ -1697,7 +1696,8 @@ sensors_w83781d_init(void) ...@@ -1697,7 +1696,8 @@ sensors_w83781d_init(void)
static void __exit static void __exit
sensors_w83781d_exit(void) sensors_w83781d_exit(void)
{ {
i2c_isa_del_driver(&w83781d_isa_driver); if (isa_address)
i2c_isa_del_driver(&w83781d_isa_driver);
i2c_del_driver(&w83781d_driver); i2c_del_driver(&w83781d_driver);
} }
......
...@@ -91,7 +91,7 @@ int i2c_isa_add_driver(struct i2c_driver *driver) ...@@ -91,7 +91,7 @@ int i2c_isa_add_driver(struct i2c_driver *driver)
/* Now look for clients */ /* Now look for clients */
res = driver->attach_adapter(&isa_adapter); res = driver->attach_adapter(&isa_adapter);
if (res) { if (res) {
dev_err(&isa_adapter.dev, dev_dbg(&isa_adapter.dev,
"Driver %s failed to attach adapter, unregistering\n", "Driver %s failed to attach adapter, unregistering\n",
driver->driver.name); driver->driver.name);
driver_unregister(&driver->driver); driver_unregister(&driver->driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment