From fde0950903ce8cc38a91dd095280decceda2ff82 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 19 Jul 2005 23:51:07 +0200 Subject: [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (3/9) Convert the 10 ISA hardware monitoring drivers (it87, lm78, pc87360, sis5595, smsc47b397, smsc47m1, via686a, w83627hf, w83627ehf, w83781d) to explicitely register with i2c-isa. For hybrid drivers (it87, lm78, w83781d), we now have two separate instances of i2c_driver, one for the I2C interface of the chip, and one for ISA interface. In the long run, the one for ISA will be replaced with a different driver type. At this point, all drivers are working again, except for missing dependencies in Kconfig. Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/it87.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'drivers/hwmon/it87.c') diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 92c5b2420f9b..a438adb4b09f 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -242,6 +243,14 @@ static struct i2c_driver it87_driver = { .detach_client = it87_detach_client, }; +static struct i2c_driver it87_isa_driver = { + .owner = THIS_MODULE, + .name = "it87-isa", + .attach_adapter = it87_attach_adapter, + .detach_client = it87_detach_client, +}; + + static ssize_t show_in(struct device *dev, struct device_attribute *attr, char *buf) { @@ -741,7 +750,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) /* Reserve the ISA region */ if (is_isa) - if (!request_region(address, IT87_EXTENT, it87_driver.name)) + if (!request_region(address, IT87_EXTENT, it87_isa_driver.name)) goto ERROR0; /* Probe whether there is anything available on this address. Already @@ -787,7 +796,7 @@ int it87_detect(struct i2c_adapter *adapter, int address, int kind) i2c_set_clientdata(new_client, data); new_client->addr = address; new_client->adapter = adapter; - new_client->driver = &it87_driver; + new_client->driver = is_isa ? &it87_isa_driver : &it87_driver; new_client->flags = 0; /* Now, we do the remaining detection. */ @@ -1172,16 +1181,28 @@ static struct it87_data *it87_update_device(struct device *dev) static int __init sm_it87_init(void) { - int addr; + int addr, res; if (!it87_find(&addr)) { normal_isa[0] = addr; } - return i2c_add_driver(&it87_driver); + + res = i2c_add_driver(&it87_driver); + if (res) + return res; + + res = i2c_isa_add_driver(&it87_isa_driver); + if (res) { + i2c_del_driver(&it87_driver); + return res; + } + + return 0; } static void __exit sm_it87_exit(void) { + i2c_isa_del_driver(&it87_isa_driver); i2c_del_driver(&it87_driver); } -- cgit v1.2.3