Remove owner from i2c_adapter, restore inc_use and dec_use

instead.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2772 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2004-11-25 21:51:18 +00:00
1 parent f7d00ae81d
commit a223ec0fd5
20 files changed
+321 -31

No files matched your search

+15 -1
View File
@@ -511,6 +511,19 @@ EXIT:
return result;
}
static void ali1535_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void ali1535_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
u32 ali1535_func(struct i2c_adapter *adapter)
{
@@ -527,10 +540,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter ali1535_adapter = {
.owner = THIS_MODULE,
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI1535,
.algo = &smbus_algorithm,
.inc_use = ali1535_inc,
.dec_use = ali1535_dec,
};
+17 -2
View File
@@ -454,6 +454,20 @@ static s32 ali15x3_access(struct i2c_adapter * adap, u16 addr,
return 0;
}
static void ali15x3_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void ali15x3_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static u32 ali15x3_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
@@ -469,10 +483,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter ali15x3_adapter = {
.owner = THIS_MODULE,
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_ALI15X3,
.algo = &smbus_algorithm,
.name = "unset",
.name = "unset",
.inc_use = ali15x3_inc,
.dec_use = ali15x3_dec,
};
static struct pci_device_id ali15x3_ids[] __devinitdata = {
+16 -1
View File
@@ -294,6 +294,20 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
return 0;
}
static void amd756_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void amd756_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static u32 amd756_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
@@ -309,10 +323,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
struct i2c_adapter amd756_smbus = {
.owner = THIS_MODULE,
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD756,
.algo = &smbus_algorithm,
.inc_use = amd756_inc,
.dec_use = amd756_dec,
};
enum chiptype { AMD756, AMD766, AMD768, NFORCE, AMD8111 };
+15 -1
View File
@@ -324,6 +324,19 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags,
return 0;
}
static void amd8111_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void amd8111_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
u32 amd8111_func(struct i2c_adapter *adapter)
{
@@ -368,11 +381,12 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
return -1;
}
smbus->adapter.owner = THIS_MODULE;
sprintf(smbus->adapter.name, "SMBus2 AMD8111 adapter at %04x", smbus->base);
smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_AMD8111;
smbus->adapter.algo = &smbus_algorithm;
smbus->adapter.algo_data = smbus;
smbus->adapter.inc_use = amd8111_inc;
smbus->adapter.dec_use = amd8111_dec;
error = i2c_add_adapter(&smbus->adapter);
if (error) {
+17 -2
View File
@@ -99,6 +99,20 @@ static int bit_hydra_getsda(void *data)
return (pdregr() & HYDRA_SDAT) != 0;
}
static void bit_hydra_inc(struct i2c_adapter *adap)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void bit_hydra_dec(struct i2c_adapter *adap)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
/* ------------------------------------------------------------------------ */
static struct i2c_algo_bit_data bit_hydra_data = {
@@ -112,10 +126,11 @@ static struct i2c_algo_bit_data bit_hydra_data = {
};
static struct i2c_adapter bit_hydra_ops = {
.owner = THIS_MODULE,
.name = "Hydra i2c",
.id = I2C_HW_B_HYDRA,
.algo_data = &bit_hydra_data,
.algo_data = &bit_hydra_data,
.inc_use = bit_hydra_inc,
.dec_use = bit_hydra_dec,
};
static struct pci_device_id hydra_ids[] __devinitdata = {
+16 -2
View File
@@ -527,6 +527,19 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
return 0;
}
static void i801_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void i801_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static u32 i801_func(struct i2c_adapter *adapter)
{
@@ -549,10 +562,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter i801_adapter = {
.owner = THIS_MODULE,
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_I801,
.algo = &smbus_algorithm,
.name = "unset",
.name = "unset",
.inc_use = i801_inc,
.dec_use = i801_dec,
};
static struct pci_device_id i801_ids[] __devinitdata = {
+17 -2
View File
@@ -171,6 +171,19 @@ void config_i810(struct pci_dev *dev)
}
}
static void i810_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void i810_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static struct i2c_algo_bit_data i810_i2c_bit_data = {
.setsda = bit_i810i2c_setsda,
@@ -183,10 +196,11 @@ static struct i2c_algo_bit_data i810_i2c_bit_data = {
};
static struct i2c_adapter i810_i2c_adapter = {
.owner = THIS_MODULE,
.name = "I810/I815 I2C Adapter",
.id = I2C_HW_B_I810,
.algo_data = &i810_i2c_bit_data,
.inc_use = i810_inc,
.dec_use = i810_dec,
};
static struct i2c_algo_bit_data i810_ddc_bit_data = {
@@ -200,10 +214,11 @@ static struct i2c_algo_bit_data i810_ddc_bit_data = {
};
static struct i2c_adapter i810_ddc_adapter = {
.owner = THIS_MODULE,
.name = "I810/I815 DDC Adapter",
.id = I2C_HW_B_I810,
.algo_data = &i810_ddc_bit_data,
.inc_use = i810_inc,
.dec_use = i810_dec,
};
+16 -1
View File
@@ -34,6 +34,20 @@
static u32 i2c_ipmi_func(struct i2c_adapter *adapter);
static int bmcclient_i2c_send_message(struct i2c_adapter *, char *, int);
static void i2c_ipmi_inc_use(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void i2c_ipmi_dec_use(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
/* I2C Data */
static struct i2c_algorithm i2c_ipmi_algorithm = {
.name = "IPMI algorithm",
@@ -43,10 +57,11 @@ static struct i2c_algorithm i2c_ipmi_algorithm = {
};
static struct i2c_adapter i2c_ipmi_adapter = {
.owner = THIS_MODULE,
.name = "IPMI adapter",
.id = I2C_ALGO_IPMI | I2C_HW_IPMI,
.algo = &i2c_ipmi_algorithm,
.inc_use = &i2c_ipmi_inc_use,
.dec_use = &i2c_ipmi_dec_use,
};
/* IPMI Data */
+16 -1
View File
@@ -40,12 +40,27 @@ static struct i2c_algorithm isa_algorithm = {
.functionality = isa_func,
};
static void isa_inc_use(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void isa_dec_use(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
/* There can only be one... */
static struct i2c_adapter isa_adapter = {
.owner = THIS_MODULE,
.name = "ISA main adapter",
.id = I2C_ALGO_ISA | I2C_HW_ISA,
.algo = &isa_algorithm,
.inc_use = isa_inc_use,
.dec_use = isa_dec_use,
};
/* We can't do a thing... */
+17
View File
@@ -414,6 +414,21 @@ keywest_func(struct i2c_adapter * adapter)
I2C_FUNC_SMBUS_BLOCK_DATA;
}
static void
keywest_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void
keywest_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
/* For now, we only handle combined mode (smbus) */
static struct i2c_algorithm keywest_algorithm = {
@@ -524,6 +539,8 @@ create_iface(struct device_node* np)
chan->adapter.id = I2C_ALGO_SMBUS;
chan->adapter.algo = &keywest_algorithm;
chan->adapter.algo_data = NULL;
chan->adapter.inc_use = keywest_inc;
chan->adapter.dec_use = keywest_dec;
chan->adapter.client_register = NULL;
chan->adapter.client_unregister = NULL;
chan->adapter.data = chan;
+15 -6
View File
@@ -294,6 +294,19 @@ u32 nforce2_func(struct i2c_adapter *adapter)
I2C_FUNC_SMBUS_BLOCK_DATA */;
}
static void nforce2_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void nforce2_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static struct pci_device_id nforce2_ids[] = {
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS,
@@ -322,16 +335,12 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg, struct nfo
return -1;
}
/* TODO: find a better way to find out whether this file is compiled
* with i2c 2.7.0 of earlier
*/
#ifdef I2C_HW_SMBUS_AMD8111
smbus->adapter.owner = THIS_MODULE;
#endif
sprintf(smbus->adapter.name, "SMBus nForce2 adapter at %04x", smbus->base);
smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_NFORCE2;
smbus->adapter.algo = &smbus_algorithm;
smbus->adapter.algo_data = smbus;
smbus->adapter.inc_use = nforce2_inc;
smbus->adapter.dec_use = nforce2_dec;
error = i2c_add_adapter(&smbus->adapter);
if (error) {
+15 -1
View File
@@ -419,6 +419,19 @@ s32 piix4_access(struct i2c_adapter * adap, u16 addr,
return 0;
}
static void piix4_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void piix4_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
u32 piix4_func(struct i2c_adapter *adapter)
{
@@ -435,10 +448,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter piix4_adapter = {
.owner = THIS_MODULE,
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_PIIX4,
.algo = &smbus_algorithm,
.inc_use = piix4_inc,
.dec_use = piix4_dec,
};
#ifndef PCI_DEVICE_ID_SERVERWORKS_CSB6
+15 -1
View File
@@ -136,6 +136,19 @@ void config_s4(struct pci_dev *dev)
}
}
static void savage4_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void savage4_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static struct i2c_algo_bit_data sav_i2c_bit_data = {
.setsda = bit_savi2c_setsda,
@@ -148,10 +161,11 @@ static struct i2c_algo_bit_data sav_i2c_bit_data = {
};
static struct i2c_adapter savage4_i2c_adapter = {
.owner = THIS_MODULE,
.name = "I2C Savage4 adapter",
.id = I2C_HW_B_SAVG,
.algo_data = &sav_i2c_bit_data,
.inc_use = savage4_inc,
.dec_use = savage4_dec,
};
static struct pci_device_id savage4_ids[] __devinitdata = {
+15 -1
View File
@@ -394,6 +394,19 @@ s32 sis5595_access(struct i2c_adapter * adap, u16 addr,
return 0;
}
static void sis5595_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void sis5595_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
u32 sis5595_func(struct i2c_adapter *adapter)
{
@@ -411,10 +424,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter sis5595_adapter = {
.owner = THIS_MODULE,
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS5595,
.algo = &smbus_algorithm,
.inc_use = sis5595_inc,
.dec_use = sis5595_dec,
};
+16 -1
View File
@@ -383,6 +383,20 @@ static s32 sis630_access(struct i2c_adapter * adap, u16 addr,
return 0;
}
static void sis630_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void sis630_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static u32 sis630_func(struct i2c_adapter *adapter) {
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA |
@@ -455,10 +469,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter sis630_adapter = {
.owner = THIS_MODULE,
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS630,
.algo = &smbus_algorithm,
.inc_use = sis630_inc,
.dec_use = sis630_dec,
};
+16 -1
View File
@@ -459,6 +459,20 @@ static s32 sis645_access(struct i2c_adapter * adap, u16 addr,
return 0;
}
static void sis645_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void sis645_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static u32 sis645_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
@@ -474,10 +488,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter sis645_adapter = {
.owner = THIS_MODULE,
.name = "unset",
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_SIS645,
.algo = &smbus_algorithm,
.inc_use = sis645_inc,
.dec_use = sis645_dec,
};
static struct pci_device_id sis645_ids[] __devinitdata = {
+16 -1
View File
@@ -99,6 +99,20 @@ static int bit_tsunami_getsda(void *data)
return (0 != (readmpd() & MPD_DR));
}
static void i2c_tsunami_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void i2c_tsunami_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static struct i2c_algo_bit_data tsunami_i2c_bit_data = {
.setsda = bit_tsunami_setsda,
.setscl = bit_tsunami_setscl,
@@ -110,10 +124,11 @@ static struct i2c_algo_bit_data tsunami_i2c_bit_data = {
};
static struct i2c_adapter tsunami_i2c_adapter = {
.owner = THIS_MODULE,
.name = "I2C Tsunami/Typhoon adapter",
.id = I2C_HW_B_TSUNA,
.algo_data = &tsunami_i2c_bit_data,
.inc_use = i2c_tsunami_inc,
.dec_use = i2c_tsunami_dec,
};
+15 -1
View File
@@ -81,6 +81,19 @@ static int bit_via_getsda(void *data)
return (0 != (inb(I2C_IN) & I2C_SDA));
}
static void bit_via_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void bit_via_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static struct i2c_algo_bit_data bit_data = {
.setsda = bit_via_setsda,
@@ -93,10 +106,11 @@ static struct i2c_algo_bit_data bit_data = {
};
static struct i2c_adapter vt586b_adapter = {
.owner = THIS_MODULE,
.name = "VIA i2c",
.id = I2C_HW_B_VIA,
.algo_data = &bit_data,
.inc_use = bit_via_inc,
.dec_use = bit_via_dec,
};
+17 -2
View File
@@ -275,6 +275,20 @@ static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
return 0;
}
static void vt596_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
static void vt596_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static u32 vt596_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
@@ -290,10 +304,11 @@ static struct i2c_algorithm smbus_algorithm = {
};
static struct i2c_adapter vt596_adapter = {
.owner = THIS_MODULE,
.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2,
.algo = &smbus_algorithm,
.name = "unset",
.name = "unset",
.inc_use = vt596_inc,
.dec_use = vt596_dec,
};
static int __devinit vt596_probe(struct pci_dev *pdev,
+19 -3
View File
@@ -160,6 +160,20 @@ void config_v3(struct pci_dev *dev)
}
}
static void voodoo3_inc(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
}
void voodoo3_dec(struct i2c_adapter *adapter)
{
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
}
static struct i2c_algo_bit_data voo_i2c_bit_data = {
.setsda = bit_vooi2c_setsda,
.setscl = bit_vooi2c_setscl,
@@ -171,10 +185,11 @@ static struct i2c_algo_bit_data voo_i2c_bit_data = {
};
static struct i2c_adapter voodoo3_i2c_adapter = {
.owner = THIS_MODULE,
.name = "I2C Voodoo3/Banshee adapter",
.id = I2C_HW_B_VOO,
.algo_data = &voo_i2c_bit_data,
.algo_data = &voo_i2c_bit_data,
.inc_use = voodoo3_inc,
.dec_use = voodoo3_dec,
};
static struct i2c_algo_bit_data voo_ddc_bit_data = {
@@ -188,10 +203,11 @@ static struct i2c_algo_bit_data voo_ddc_bit_data = {
};
static struct i2c_adapter voodoo3_ddc_adapter = {
.owner = THIS_MODULE,
.name = "DDC Voodoo3/Banshee adapter",
.id = I2C_HW_B_VOO,
.algo_data = &voo_ddc_bit_data,
.inc_use = voodoo3_inc,
.dec_use = voodoo3_dec,
};