From: khali@linux-fr.org (Jean Delvare)
To: LKML <linux-kernel@vger.kernel.org>,
LM Sensors <lm-sensors@lm-sensors.org>
Cc: Greg KH <greg@kroah.com>
Subject: [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from
Date: Tue, 19 Jul 2005 23:51:50 +0000 [thread overview]
Message-ID: <20050719235107.56ab70d2.khali@linux-fr.org> (raw)
In-Reply-To: <20050719233902.40282559.khali@linux-fr.org>
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.
drivers/hwmon/it87.c | 29 +++++++++++++++++++++++++----
drivers/hwmon/lm78.c | 29 ++++++++++++++++++++++++++---
drivers/hwmon/pc87360.c | 5 +++--
drivers/hwmon/sis5595.c | 5 +++--
drivers/hwmon/smsc47b397.c | 5 +++--
drivers/hwmon/smsc47m1.c | 5 +++--
drivers/hwmon/via686a.c | 5 +++--
drivers/hwmon/w83627ehf.c | 5 +++--
drivers/hwmon/w83627hf.c | 5 +++--
drivers/hwmon/w83781d.c | 28 +++++++++++++++++++++++++---
10 files changed, 97 insertions(+), 24 deletions(-)
--- linux-2.6.13-rc3.orig/drivers/hwmon/it87.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/it87.c 2005-07-16 20:15:39.000000000 +0200
@@ -36,6 +36,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon-sysfs.h>
@@ -242,6 +243,14 @@
.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 @@
/* 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 @@
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 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);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/lm78.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/lm78.c 2005-07-16 20:17:04.000000000 +0200
@@ -23,6 +23,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -177,6 +178,14 @@
.detach_client = lm78_detach_client,
};
+static struct i2c_driver lm78_isa_driver = {
+ .owner = THIS_MODULE,
+ .name = "lm78-isa",
+ .attach_adapter = lm78_attach_adapter,
+ .detach_client = lm78_detach_client,
+};
+
+
/* 7 Voltages */
static ssize_t show_in(struct device *dev, char *buf, int nr)
{
@@ -488,7 +497,8 @@
/* Reserve the ISA region */
if (is_isa)
- if (!request_region(address, LM78_EXTENT, lm78_driver.name)) {
+ if (!request_region(address, LM78_EXTENT,
+ lm78_isa_driver.name)) {
err = -EBUSY;
goto ERROR0;
}
@@ -543,7 +553,7 @@
i2c_set_clientdata(new_client, data);
new_client->addr = address;
new_client->adapter = adapter;
- new_client->driver = &lm78_driver;
+ new_client->driver = is_isa ? &lm78_isa_driver : &lm78_driver;
new_client->flags = 0;
/* Now, we do the remaining detection. */
@@ -791,11 +801,24 @@
static int __init sm_lm78_init(void)
{
- return i2c_add_driver(&lm78_driver);
+ int res;
+
+ res = i2c_add_driver(&lm78_driver);
+ if (res)
+ return res;
+
+ res = i2c_isa_add_driver(&lm78_isa_driver);
+ if (res) {
+ i2c_del_driver(&lm78_driver);
+ return res;
+ }
+
+ return 0;
}
static void __exit sm_lm78_exit(void)
{
+ i2c_isa_del_driver(&lm78_isa_driver);
i2c_del_driver(&lm78_driver);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/pc87360.c 2005-07-16 09:53:15.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/pc87360.c 2005-07-16 20:11:59.000000000 +0200
@@ -38,6 +38,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon.h>
@@ -1344,12 +1345,12 @@
return -ENODEV;
}
- return i2c_add_driver(&pc87360_driver);
+ return i2c_isa_add_driver(&pc87360_driver);
}
static void __exit pc87360_exit(void)
{
- i2c_del_driver(&pc87360_driver);
+ i2c_isa_del_driver(&pc87360_driver);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/sis5595.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/sis5595.c 2005-07-16 20:11:59.000000000 +0200
@@ -55,6 +55,7 @@
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -790,7 +791,7 @@
normal_isa[0] = addr;
s_bridge = pci_dev_get(dev);
- if (i2c_add_driver(&sis5595_driver)) {
+ if (i2c_isa_add_driver(&sis5595_driver)) {
pci_dev_put(s_bridge);
s_bridge = NULL;
}
@@ -817,7 +818,7 @@
{
pci_unregister_driver(&sis5595_pci_driver);
if (s_bridge != NULL) {
- i2c_del_driver(&sis5595_driver);
+ i2c_isa_del_driver(&sis5595_driver);
pci_dev_put(s_bridge);
s_bridge = NULL;
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/smsc47b397.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/smsc47b397.c 2005-07-16 20:11:59.000000000 +0200
@@ -31,6 +31,7 @@
#include <linux/ioport.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -350,12 +351,12 @@
if ((ret = smsc47b397_find(normal_isa)))
return ret;
- return i2c_add_driver(&smsc47b397_driver);
+ return i2c_isa_add_driver(&smsc47b397_driver);
}
static void __exit smsc47b397_exit(void)
{
- i2c_del_driver(&smsc47b397_driver);
+ i2c_isa_del_driver(&smsc47b397_driver);
}
MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
--- linux-2.6.13-rc3.orig/drivers/hwmon/smsc47m1.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/smsc47m1.c 2005-07-16 20:11:59.000000000 +0200
@@ -30,6 +30,7 @@
#include <linux/ioport.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -592,12 +593,12 @@
return -ENODEV;
}
- return i2c_add_driver(&smsc47m1_driver);
+ return i2c_isa_add_driver(&smsc47m1_driver);
}
static void __exit sm_smsc47m1_exit(void)
{
- i2c_del_driver(&smsc47m1_driver);
+ i2c_isa_del_driver(&smsc47m1_driver);
}
MODULE_AUTHOR("Mark D. Studebaker <mdsxyz123@yahoo.com>");
--- linux-2.6.13-rc3.orig/drivers/hwmon/via686a.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/via686a.c 2005-07-16 20:11:59.000000000 +0200
@@ -35,6 +35,7 @@
#include <linux/pci.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -846,7 +847,7 @@
normal_isa[0] = addr;
s_bridge = pci_dev_get(dev);
- if (i2c_add_driver(&via686a_driver)) {
+ if (i2c_isa_add_driver(&via686a_driver)) {
pci_dev_put(s_bridge);
s_bridge = NULL;
}
@@ -873,7 +874,7 @@
{
pci_unregister_driver(&via686a_pci_driver);
if (s_bridge != NULL) {
- i2c_del_driver(&via686a_driver);
+ i2c_isa_del_driver(&via686a_driver);
pci_dev_put(s_bridge);
s_bridge = NULL;
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/w83627hf.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/w83627hf.c 2005-07-16 20:11:59.000000000 +0200
@@ -42,6 +42,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon.h>
@@ -1507,12 +1508,12 @@
}
normal_isa[0] = addr;
- return i2c_add_driver(&w83627hf_driver);
+ return i2c_isa_add_driver(&w83627hf_driver);
}
static void __exit sensors_w83627hf_exit(void)
{
- i2c_del_driver(&w83627hf_driver);
+ i2c_isa_del_driver(&w83627hf_driver);
}
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, "
--- linux-2.6.13-rc3.orig/drivers/hwmon/w83781d.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/w83781d.c 2005-07-16 20:17:22.000000000 +0200
@@ -38,6 +38,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon.h>
@@ -276,6 +277,14 @@
.detach_client = w83781d_detach_client,
};
+static struct i2c_driver w83781d_isa_driver = {
+ .owner = THIS_MODULE,
+ .name = "w83781d-isa",
+ .attach_adapter = w83781d_attach_adapter,
+ .detach_client = w83781d_detach_client,
+};
+
+
/* following are the sysfs callback functions */
#define show_in_reg(reg) \
static ssize_t show_##reg (struct device *dev, char *buf, int nr) \
@@ -1002,7 +1011,7 @@
if (is_isa)
if (!request_region(address, W83781D_EXTENT,
- w83781d_driver.name)) {
+ w83781d_isa_driver.name)) {
dev_dbg(&adapter->dev, "Request of region "
"0x%x-0x%x for w83781d failed\n", address,
address + W83781D_EXTENT - 1);
@@ -1060,7 +1069,7 @@
new_client->addr = address;
init_MUTEX(&data->lock);
new_client->adapter = adapter;
- new_client->driver = &w83781d_driver;
+ new_client->driver = is_isa ? &w83781d_isa_driver : &w83781d_driver;
new_client->flags = 0;
/* Now, we do the remaining detection. */
@@ -1636,12 +1645,25 @@
static int __init
sensors_w83781d_init(void)
{
- return i2c_add_driver(&w83781d_driver);
+ int res;
+
+ res = i2c_add_driver(&w83781d_driver);
+ if (res)
+ return res;
+
+ res = i2c_isa_add_driver(&w83781d_isa_driver);
+ if (res) {
+ i2c_del_driver(&w83781d_driver);
+ return res;
+ }
+
+ return 0;
}
static void __exit
sensors_w83781d_exit(void)
{
+ i2c_isa_del_driver(&w83781d_isa_driver);
i2c_del_driver(&w83781d_driver);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/w83627ehf.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/w83627ehf.c 2005-07-16 20:14:00.000000000 +0200
@@ -37,6 +37,7 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -844,12 +845,12 @@
&& w83627ehf_find(0x4e, &normal_isa[0]))
return -ENODEV;
- return i2c_add_driver(&w83627ehf_driver);
+ return i2c_isa_add_driver(&w83627ehf_driver);
}
static void __exit sensors_w83627ehf_exit(void)
{
- i2c_del_driver(&w83627ehf_driver);
+ i2c_isa_del_driver(&w83627ehf_driver);
}
MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
--
Jean Delvare
WARNING: multiple messages have this Message-ID (diff)
From: Jean Delvare <khali@linux-fr.org>
To: LKML <linux-kernel@vger.kernel.org>,
LM Sensors <lm-sensors@lm-sensors.org>
Cc: Greg KH <greg@kroah.com>
Subject: [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (3/9)
Date: Tue, 19 Jul 2005 23:51:07 +0200 [thread overview]
Message-ID: <20050719235107.56ab70d2.khali@linux-fr.org> (raw)
In-Reply-To: <20050719233902.40282559.khali@linux-fr.org>
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.
drivers/hwmon/it87.c | 29 +++++++++++++++++++++++++----
drivers/hwmon/lm78.c | 29 ++++++++++++++++++++++++++---
drivers/hwmon/pc87360.c | 5 +++--
drivers/hwmon/sis5595.c | 5 +++--
drivers/hwmon/smsc47b397.c | 5 +++--
drivers/hwmon/smsc47m1.c | 5 +++--
drivers/hwmon/via686a.c | 5 +++--
drivers/hwmon/w83627ehf.c | 5 +++--
drivers/hwmon/w83627hf.c | 5 +++--
drivers/hwmon/w83781d.c | 28 +++++++++++++++++++++++++---
10 files changed, 97 insertions(+), 24 deletions(-)
--- linux-2.6.13-rc3.orig/drivers/hwmon/it87.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/it87.c 2005-07-16 20:15:39.000000000 +0200
@@ -36,6 +36,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon-sysfs.h>
@@ -242,6 +243,14 @@
.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 @@
/* 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 @@
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 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);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/lm78.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/lm78.c 2005-07-16 20:17:04.000000000 +0200
@@ -23,6 +23,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -177,6 +178,14 @@
.detach_client = lm78_detach_client,
};
+static struct i2c_driver lm78_isa_driver = {
+ .owner = THIS_MODULE,
+ .name = "lm78-isa",
+ .attach_adapter = lm78_attach_adapter,
+ .detach_client = lm78_detach_client,
+};
+
+
/* 7 Voltages */
static ssize_t show_in(struct device *dev, char *buf, int nr)
{
@@ -488,7 +497,8 @@
/* Reserve the ISA region */
if (is_isa)
- if (!request_region(address, LM78_EXTENT, lm78_driver.name)) {
+ if (!request_region(address, LM78_EXTENT,
+ lm78_isa_driver.name)) {
err = -EBUSY;
goto ERROR0;
}
@@ -543,7 +553,7 @@
i2c_set_clientdata(new_client, data);
new_client->addr = address;
new_client->adapter = adapter;
- new_client->driver = &lm78_driver;
+ new_client->driver = is_isa ? &lm78_isa_driver : &lm78_driver;
new_client->flags = 0;
/* Now, we do the remaining detection. */
@@ -791,11 +801,24 @@
static int __init sm_lm78_init(void)
{
- return i2c_add_driver(&lm78_driver);
+ int res;
+
+ res = i2c_add_driver(&lm78_driver);
+ if (res)
+ return res;
+
+ res = i2c_isa_add_driver(&lm78_isa_driver);
+ if (res) {
+ i2c_del_driver(&lm78_driver);
+ return res;
+ }
+
+ return 0;
}
static void __exit sm_lm78_exit(void)
{
+ i2c_isa_del_driver(&lm78_isa_driver);
i2c_del_driver(&lm78_driver);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/pc87360.c 2005-07-16 09:53:15.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/pc87360.c 2005-07-16 20:11:59.000000000 +0200
@@ -38,6 +38,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon.h>
@@ -1344,12 +1345,12 @@
return -ENODEV;
}
- return i2c_add_driver(&pc87360_driver);
+ return i2c_isa_add_driver(&pc87360_driver);
}
static void __exit pc87360_exit(void)
{
- i2c_del_driver(&pc87360_driver);
+ i2c_isa_del_driver(&pc87360_driver);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/sis5595.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/sis5595.c 2005-07-16 20:11:59.000000000 +0200
@@ -55,6 +55,7 @@
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -790,7 +791,7 @@
normal_isa[0] = addr;
s_bridge = pci_dev_get(dev);
- if (i2c_add_driver(&sis5595_driver)) {
+ if (i2c_isa_add_driver(&sis5595_driver)) {
pci_dev_put(s_bridge);
s_bridge = NULL;
}
@@ -817,7 +818,7 @@
{
pci_unregister_driver(&sis5595_pci_driver);
if (s_bridge != NULL) {
- i2c_del_driver(&sis5595_driver);
+ i2c_isa_del_driver(&sis5595_driver);
pci_dev_put(s_bridge);
s_bridge = NULL;
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/smsc47b397.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/smsc47b397.c 2005-07-16 20:11:59.000000000 +0200
@@ -31,6 +31,7 @@
#include <linux/ioport.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -350,12 +351,12 @@
if ((ret = smsc47b397_find(normal_isa)))
return ret;
- return i2c_add_driver(&smsc47b397_driver);
+ return i2c_isa_add_driver(&smsc47b397_driver);
}
static void __exit smsc47b397_exit(void)
{
- i2c_del_driver(&smsc47b397_driver);
+ i2c_isa_del_driver(&smsc47b397_driver);
}
MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
--- linux-2.6.13-rc3.orig/drivers/hwmon/smsc47m1.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/smsc47m1.c 2005-07-16 20:11:59.000000000 +0200
@@ -30,6 +30,7 @@
#include <linux/ioport.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -592,12 +593,12 @@
return -ENODEV;
}
- return i2c_add_driver(&smsc47m1_driver);
+ return i2c_isa_add_driver(&smsc47m1_driver);
}
static void __exit sm_smsc47m1_exit(void)
{
- i2c_del_driver(&smsc47m1_driver);
+ i2c_isa_del_driver(&smsc47m1_driver);
}
MODULE_AUTHOR("Mark D. Studebaker <mdsxyz123@yahoo.com>");
--- linux-2.6.13-rc3.orig/drivers/hwmon/via686a.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/via686a.c 2005-07-16 20:11:59.000000000 +0200
@@ -35,6 +35,7 @@
#include <linux/pci.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -846,7 +847,7 @@
normal_isa[0] = addr;
s_bridge = pci_dev_get(dev);
- if (i2c_add_driver(&via686a_driver)) {
+ if (i2c_isa_add_driver(&via686a_driver)) {
pci_dev_put(s_bridge);
s_bridge = NULL;
}
@@ -873,7 +874,7 @@
{
pci_unregister_driver(&via686a_pci_driver);
if (s_bridge != NULL) {
- i2c_del_driver(&via686a_driver);
+ i2c_isa_del_driver(&via686a_driver);
pci_dev_put(s_bridge);
s_bridge = NULL;
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/w83627hf.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/w83627hf.c 2005-07-16 20:11:59.000000000 +0200
@@ -42,6 +42,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon.h>
@@ -1507,12 +1508,12 @@
}
normal_isa[0] = addr;
- return i2c_add_driver(&w83627hf_driver);
+ return i2c_isa_add_driver(&w83627hf_driver);
}
static void __exit sensors_w83627hf_exit(void)
{
- i2c_del_driver(&w83627hf_driver);
+ i2c_isa_del_driver(&w83627hf_driver);
}
MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, "
--- linux-2.6.13-rc3.orig/drivers/hwmon/w83781d.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/w83781d.c 2005-07-16 20:17:22.000000000 +0200
@@ -38,6 +38,7 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/i2c-vid.h>
#include <linux/hwmon.h>
@@ -276,6 +277,14 @@
.detach_client = w83781d_detach_client,
};
+static struct i2c_driver w83781d_isa_driver = {
+ .owner = THIS_MODULE,
+ .name = "w83781d-isa",
+ .attach_adapter = w83781d_attach_adapter,
+ .detach_client = w83781d_detach_client,
+};
+
+
/* following are the sysfs callback functions */
#define show_in_reg(reg) \
static ssize_t show_##reg (struct device *dev, char *buf, int nr) \
@@ -1002,7 +1011,7 @@
if (is_isa)
if (!request_region(address, W83781D_EXTENT,
- w83781d_driver.name)) {
+ w83781d_isa_driver.name)) {
dev_dbg(&adapter->dev, "Request of region "
"0x%x-0x%x for w83781d failed\n", address,
address + W83781D_EXTENT - 1);
@@ -1060,7 +1069,7 @@
new_client->addr = address;
init_MUTEX(&data->lock);
new_client->adapter = adapter;
- new_client->driver = &w83781d_driver;
+ new_client->driver = is_isa ? &w83781d_isa_driver : &w83781d_driver;
new_client->flags = 0;
/* Now, we do the remaining detection. */
@@ -1636,12 +1645,25 @@
static int __init
sensors_w83781d_init(void)
{
- return i2c_add_driver(&w83781d_driver);
+ int res;
+
+ res = i2c_add_driver(&w83781d_driver);
+ if (res)
+ return res;
+
+ res = i2c_isa_add_driver(&w83781d_isa_driver);
+ if (res) {
+ i2c_del_driver(&w83781d_driver);
+ return res;
+ }
+
+ return 0;
}
static void __exit
sensors_w83781d_exit(void)
{
+ i2c_isa_del_driver(&w83781d_isa_driver);
i2c_del_driver(&w83781d_driver);
}
--- linux-2.6.13-rc3.orig/drivers/hwmon/w83627ehf.c 2005-07-16 09:53:09.000000000 +0200
+++ linux-2.6.13-rc3/drivers/hwmon/w83627ehf.c 2005-07-16 20:14:00.000000000 +0200
@@ -37,6 +37,7 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
+#include <linux/i2c-isa.h>
#include <linux/i2c-sensor.h>
#include <linux/hwmon.h>
#include <linux/err.h>
@@ -844,12 +845,12 @@
&& w83627ehf_find(0x4e, &normal_isa[0]))
return -ENODEV;
- return i2c_add_driver(&w83627ehf_driver);
+ return i2c_isa_add_driver(&w83627ehf_driver);
}
static void __exit sensors_w83627ehf_exit(void)
{
- i2c_del_driver(&w83627ehf_driver);
+ i2c_isa_del_driver(&w83627ehf_driver);
}
MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>");
--
Jean Delvare
next prev parent reply other threads:[~2005-07-19 23:51 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-19 21:39 [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (0/9) Jean Delvare
2005-07-19 23:39 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-19 21:45 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9) Jean Delvare
2005-07-19 23:46 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-20 4:26 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9) Greg KH
2005-07-20 21:03 ` Jean Delvare
2005-07-20 23:04 ` [lm-sensors] Re: [PATCH 2.6] I2C: Separate non-i2c hwmon drivers Jean Delvare
2005-07-19 21:48 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9) Jean Delvare
2005-07-19 23:49 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-20 4:27 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9) Greg KH
2005-07-20 21:46 ` Jean Delvare
2005-07-20 23:46 ` [lm-sensors] Re: [PATCH 2.6] I2C: Separate non-i2c hwmon drivers Jean Delvare
2005-07-25 0:35 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9) Greg KH
2005-07-25 6:22 ` [lm-sensors] Re: [PATCH 2.6] I2C: Separate non-i2c hwmon drivers Greg KH
2005-07-25 17:28 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9) Jean Delvare
2005-07-25 19:28 ` [lm-sensors] Re: [PATCH 2.6] I2C: Separate non-i2c hwmon drivers Jean Delvare
2005-07-26 22:54 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9) Greg KH
2005-07-27 0:55 ` [lm-sensors] Re: [PATCH 2.6] I2C: Separate non-i2c hwmon drivers Greg KH
2005-07-27 20:21 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9) Jean Delvare
2005-07-27 22:21 ` [lm-sensors] Re: [PATCH 2.6] I2C: Separate non-i2c hwmon drivers Jean Delvare
2005-07-19 21:51 ` Jean Delvare [this message]
2005-07-19 23:51 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-19 21:53 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (4/9) Jean Delvare
2005-07-19 23:53 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-19 21:56 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (5/9) Jean Delvare
2005-07-19 23:57 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-26 22:33 ` patch i2c-hwmon-split-05.patch added to gregkh-2.6 tree gregkh
2005-07-27 0:33 ` [lm-sensors] " gregkh
2005-07-19 21:57 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (6/9) Jean Delvare
2005-07-19 23:58 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-19 22:02 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9) Jean Delvare
2005-07-20 0:02 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-19 22:05 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (8/9) Jean Delvare
2005-07-20 0:06 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-26 22:33 ` patch i2c-hwmon-split-08.patch added to gregkh-2.6 tree gregkh
2005-07-27 0:33 ` [lm-sensors] " gregkh
2005-07-19 22:09 ` [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from i2c-core (9/9) Jean Delvare
2005-07-20 0:09 ` [lm-sensors] [PATCH 2.6] I2C: Separate non-i2c hwmon drivers from Jean Delvare
2005-07-26 22:33 ` patch i2c-hwmon-split-09.patch added to gregkh-2.6 tree gregkh
2005-07-27 0:33 ` [lm-sensors] " gregkh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050719235107.56ab70d2.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.