From ff179c8cf5caa17bf3d407edbb5872aa2eee6900 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 20:24:59 +0100 Subject: [PATCH] i2c: Drop i2c_driver.flags, 1 of 3 The I2C_DF_DUMMY flag is gone since 2.5.70, it's about time to drop all ifdef'd out references thereto. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 5e19a7ba69b2..0316ba1294ca 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -252,11 +252,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) /*flags for the driver struct: */ #define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ -#if 0 -/* this flag is gone -- there is a (optional) driver->detach_adapter - * callback now which can be used instead */ -# define I2C_DF_DUMMY 0x02 -#endif /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ -- cgit v1.2.3 From 8a9947552d43b0d20d5fa23ac0ba435d526be454 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 20:28:06 +0100 Subject: [PATCH] i2c: Drop i2c_driver.flags, 2 of 3 Just about every i2c chip driver sets the I2C_DF_NOTIFY flag, so we can simply make it the default and drop the flag. If any driver really doesn't want to be notified when i2c adapters are added, that driver can simply omit to set .attach_adapter. This approach is also more robust as it prevents accidental NULL pointer dereferences. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- Documentation/i2c/porting-clients | 3 +++ Documentation/i2c/writing-clients | 5 ----- arch/arm/mach-pxa/akita-ioexp.c | 1 - drivers/acorn/char/pcf8583.c | 1 - drivers/hwmon/adm1021.c | 1 - drivers/hwmon/adm1025.c | 1 - drivers/hwmon/adm1026.c | 1 - drivers/hwmon/adm1031.c | 1 - drivers/hwmon/adm9240.c | 1 - drivers/hwmon/asb100.c | 1 - drivers/hwmon/atxp1.c | 1 - drivers/hwmon/ds1621.c | 1 - drivers/hwmon/fscher.c | 1 - drivers/hwmon/fscpos.c | 1 - drivers/hwmon/gl518sm.c | 1 - drivers/hwmon/gl520sm.c | 1 - drivers/hwmon/it87.c | 1 - drivers/hwmon/lm63.c | 1 - drivers/hwmon/lm75.c | 1 - drivers/hwmon/lm77.c | 1 - drivers/hwmon/lm78.c | 1 - drivers/hwmon/lm80.c | 1 - drivers/hwmon/lm83.c | 1 - drivers/hwmon/lm85.c | 1 - drivers/hwmon/lm87.c | 1 - drivers/hwmon/lm90.c | 1 - drivers/hwmon/lm92.c | 1 - drivers/hwmon/max1619.c | 1 - drivers/hwmon/w83781d.c | 1 - drivers/hwmon/w83792d.c | 1 - drivers/hwmon/w83l785ts.c | 1 - drivers/i2c/chips/ds1337.c | 1 - drivers/i2c/chips/ds1374.c | 1 - drivers/i2c/chips/eeprom.c | 1 - drivers/i2c/chips/isp1301_omap.c | 1 - drivers/i2c/chips/m41t00.c | 1 - drivers/i2c/chips/max6875.c | 1 - drivers/i2c/chips/pca9539.c | 1 - drivers/i2c/chips/pcf8574.c | 1 - drivers/i2c/chips/pcf8591.c | 1 - drivers/i2c/chips/rtc8564.c | 1 - drivers/i2c/chips/tps65010.c | 1 - drivers/i2c/chips/x1205.c | 1 - drivers/i2c/i2c-core.c | 4 ++-- drivers/i2c/i2c-dev.c | 1 - drivers/macintosh/therm_adt746x.c | 1 - drivers/macintosh/therm_pm72.c | 1 - drivers/macintosh/therm_windtunnel.c | 1 - drivers/macintosh/windfarm_lm75_sensor.c | 1 - drivers/media/video/adv7170.c | 1 - drivers/media/video/adv7175.c | 1 - drivers/media/video/bt819.c | 1 - drivers/media/video/bt832.c | 1 - drivers/media/video/bt856.c | 1 - drivers/media/video/cs53l32a.c | 1 - drivers/media/video/cx25840/cx25840-core.c | 1 - drivers/media/video/indycam.c | 1 - drivers/media/video/ir-kbd-i2c.c | 1 - drivers/media/video/msp3400.c | 1 - drivers/media/video/ovcamchip/ovcamchip_core.c | 1 - drivers/media/video/saa5246a.c | 1 - drivers/media/video/saa5249.c | 1 - drivers/media/video/saa6588.c | 1 - drivers/media/video/saa7110.c | 1 - drivers/media/video/saa7111.c | 1 - drivers/media/video/saa7114.c | 1 - drivers/media/video/saa7115.c | 1 - drivers/media/video/saa711x.c | 1 - drivers/media/video/saa7127.c | 1 - drivers/media/video/saa7134/saa6752hs.c | 1 - drivers/media/video/saa7185.c | 1 - drivers/media/video/saa7191.c | 1 - drivers/media/video/tda7432.c | 1 - drivers/media/video/tda9840.c | 1 - drivers/media/video/tda9875.c | 1 - drivers/media/video/tda9887.c | 1 - drivers/media/video/tea6415c.c | 1 - drivers/media/video/tea6420.c | 1 - drivers/media/video/tuner-3036.c | 1 - drivers/media/video/tuner-core.c | 1 - drivers/media/video/tvaudio.c | 1 - drivers/media/video/tveeprom.c | 1 - drivers/media/video/tvmixer.c | 1 - drivers/media/video/tvp5150.c | 1 - drivers/media/video/vpx3220.c | 1 - drivers/media/video/wm8775.c | 1 - drivers/video/matrox/matroxfb_maven.c | 1 - include/linux/i2c.h | 1 - sound/oss/dmasound/dac3550a.c | 1 - sound/oss/dmasound/tas_common.c | 1 - sound/ppc/keywest.c | 1 - 91 files changed, 5 insertions(+), 95 deletions(-) (limited to 'include') diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index 184fac2377aa..64c610bf2fbc 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients @@ -109,6 +109,9 @@ Technical changes: there is a MODULE_LICENSE() line, at the bottom of the file (after MODULE_AUTHOR() and MODULE_DESCRIPTION(), in this order). +* [Driver] The flags field of the i2c_driver structure is gone. + I2C_DF_NOTIFY is now the default behavior. + Coding policy: * [Copyright] Use (C), not (c), for copyright. diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index d19993cc0604..59d2c169cd61 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients @@ -27,7 +27,6 @@ address. static struct i2c_driver foo_driver = { .owner = THIS_MODULE, .name = "Foo version 2.3 driver", - .flags = I2C_DF_NOTIFY, .attach_adapter = &foo_attach_adapter, .detach_client = &foo_detach_client, .command = &foo_command /* may be NULL */ @@ -36,10 +35,6 @@ static struct i2c_driver foo_driver = { The name field must match the driver name, including the case. It must not contain spaces, and may be up to 31 characters long. -Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This -means that your driver will be notified when new adapters are found. -This is almost always what you want. - All other fields are for call-back functions which will be explained below. diff --git a/arch/arm/mach-pxa/akita-ioexp.c b/arch/arm/mach-pxa/akita-ioexp.c index f6d73cc01f78..440ebb3c3db1 100644 --- a/arch/arm/mach-pxa/akita-ioexp.c +++ b/arch/arm/mach-pxa/akita-ioexp.c @@ -127,7 +127,6 @@ static struct i2c_driver max7310_i2c_driver = { .owner = THIS_MODULE, .name = "akita-max7310", .id = I2C_DRIVERID_AKITAIOEXP, - .flags = I2C_DF_NOTIFY, .attach_adapter = max7310_attach_adapter, .detach_client = max7310_detach_client, }; diff --git a/drivers/acorn/char/pcf8583.c b/drivers/acorn/char/pcf8583.c index e26f007a1417..befc9469b4f2 100644 --- a/drivers/acorn/char/pcf8583.c +++ b/drivers/acorn/char/pcf8583.c @@ -259,7 +259,6 @@ pcf8583_command(struct i2c_client *client, unsigned int cmd, void *arg) static struct i2c_driver pcf8583_driver = { .name = "PCF8583", .id = I2C_DRIVERID_PCF8583, - .flags = I2C_DF_NOTIFY, .attach_adapter = pcf8583_probe, .detach_client = pcf8583_detach, .command = pcf8583_command diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c index 8102876c7c3f..5e6df4b7b857 100644 --- a/drivers/hwmon/adm1021.c +++ b/drivers/hwmon/adm1021.c @@ -129,7 +129,6 @@ static struct i2c_driver adm1021_driver = { .owner = THIS_MODULE, .name = "adm1021", .id = I2C_DRIVERID_ADM1021, - .flags = I2C_DF_NOTIFY, .attach_adapter = adm1021_attach_adapter, .detach_client = adm1021_detach_client, }; diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c index bf67860e6a20..2be48a7a90b8 100644 --- a/drivers/hwmon/adm1025.c +++ b/drivers/hwmon/adm1025.c @@ -121,7 +121,6 @@ static struct i2c_driver adm1025_driver = { .owner = THIS_MODULE, .name = "adm1025", .id = I2C_DRIVERID_ADM1025, - .flags = I2C_DF_NOTIFY, .attach_adapter = adm1025_attach_adapter, .detach_client = adm1025_detach_client, }; diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index 5036b17a39cd..5416db809f97 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c @@ -310,7 +310,6 @@ static void adm1026_init_client(struct i2c_client *client); static struct i2c_driver adm1026_driver = { .owner = THIS_MODULE, .name = "adm1026", - .flags = I2C_DF_NOTIFY, .attach_adapter = adm1026_attach_adapter, .detach_client = adm1026_detach_client, }; diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c index 7c545d5eee45..1e24428090c4 100644 --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c @@ -107,7 +107,6 @@ static struct adm1031_data *adm1031_update_device(struct device *dev); static struct i2c_driver adm1031_driver = { .owner = THIS_MODULE, .name = "adm1031", - .flags = I2C_DF_NOTIFY, .attach_adapter = adm1031_attach_adapter, .detach_client = adm1031_detach_client, }; diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c index 11dc95f8a17e..287733fe2c0d 100644 --- a/drivers/hwmon/adm9240.c +++ b/drivers/hwmon/adm9240.c @@ -140,7 +140,6 @@ static struct i2c_driver adm9240_driver = { .owner = THIS_MODULE, .name = "adm9240", .id = I2C_DRIVERID_ADM9240, - .flags = I2C_DF_NOTIFY, .attach_adapter = adm9240_attach_adapter, .detach_client = adm9240_detach_client, }; diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index 52c469722a65..7227f800bef9 100644 --- a/drivers/hwmon/asb100.c +++ b/drivers/hwmon/asb100.c @@ -220,7 +220,6 @@ static struct i2c_driver asb100_driver = { .owner = THIS_MODULE, .name = "asb100", .id = I2C_DRIVERID_ASB100, - .flags = I2C_DF_NOTIFY, .attach_adapter = asb100_attach_adapter, .detach_client = asb100_detach_client, }; diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index 53324f56404e..a60a9f20281b 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c @@ -52,7 +52,6 @@ static int atxp1_detect(struct i2c_adapter *adapter, int address, int kind); static struct i2c_driver atxp1_driver = { .owner = THIS_MODULE, .name = "atxp1", - .flags = I2C_DF_NOTIFY, .attach_adapter = atxp1_attach_adapter, .detach_client = atxp1_detach_client, }; diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c index 34f71b7c7f37..0096eb37c663 100644 --- a/drivers/hwmon/ds1621.c +++ b/drivers/hwmon/ds1621.c @@ -92,7 +92,6 @@ static struct i2c_driver ds1621_driver = { .owner = THIS_MODULE, .name = "ds1621", .id = I2C_DRIVERID_DS1621, - .flags = I2C_DF_NOTIFY, .attach_adapter = ds1621_attach_adapter, .detach_client = ds1621_detach_client, }; diff --git a/drivers/hwmon/fscher.c b/drivers/hwmon/fscher.c index a02e1c34c757..f56ca06dbf88 100644 --- a/drivers/hwmon/fscher.c +++ b/drivers/hwmon/fscher.c @@ -121,7 +121,6 @@ static struct i2c_driver fscher_driver = { .owner = THIS_MODULE, .name = "fscher", .id = I2C_DRIVERID_FSCHER, - .flags = I2C_DF_NOTIFY, .attach_adapter = fscher_attach_adapter, .detach_client = fscher_detach_client, }; diff --git a/drivers/hwmon/fscpos.c b/drivers/hwmon/fscpos.c index 64e4edc64f8d..701dffc2ceed 100644 --- a/drivers/hwmon/fscpos.c +++ b/drivers/hwmon/fscpos.c @@ -103,7 +103,6 @@ static struct i2c_driver fscpos_driver = { .owner = THIS_MODULE, .name = "fscpos", .id = I2C_DRIVERID_FSCPOS, - .flags = I2C_DF_NOTIFY, .attach_adapter = fscpos_attach_adapter, .detach_client = fscpos_detach_client, }; diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c index 2f178dbe3d87..5788bbb77d8d 100644 --- a/drivers/hwmon/gl518sm.c +++ b/drivers/hwmon/gl518sm.c @@ -154,7 +154,6 @@ static struct i2c_driver gl518_driver = { .owner = THIS_MODULE, .name = "gl518sm", .id = I2C_DRIVERID_GL518, - .flags = I2C_DF_NOTIFY, .attach_adapter = gl518_attach_adapter, .detach_client = gl518_detach_client, }; diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c index c39ba1239426..b3998165193d 100644 --- a/drivers/hwmon/gl520sm.c +++ b/drivers/hwmon/gl520sm.c @@ -112,7 +112,6 @@ static struct i2c_driver gl520_driver = { .owner = THIS_MODULE, .name = "gl520sm", .id = I2C_DRIVERID_GL520, - .flags = I2C_DF_NOTIFY, .attach_adapter = gl520_attach_adapter, .detach_client = gl520_detach_client, }; diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index a61f5d00f10a..d5f0d92378c5 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -237,7 +237,6 @@ static struct i2c_driver it87_driver = { .owner = THIS_MODULE, .name = "it87", .id = I2C_DRIVERID_IT87, - .flags = I2C_DF_NOTIFY, .attach_adapter = it87_attach_adapter, .detach_client = it87_detach_client, }; diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c index 954ec2497249..c2dd4ac8042d 100644 --- a/drivers/hwmon/lm63.c +++ b/drivers/hwmon/lm63.c @@ -141,7 +141,6 @@ static void lm63_init_client(struct i2c_client *client); static struct i2c_driver lm63_driver = { .owner = THIS_MODULE, .name = "lm63", - .flags = I2C_DF_NOTIFY, .attach_adapter = lm63_attach_adapter, .detach_client = lm63_detach_client, }; diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index d70f4c8fc1e6..0bcbd6515139 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c @@ -69,7 +69,6 @@ static struct i2c_driver lm75_driver = { .owner = THIS_MODULE, .name = "lm75", .id = I2C_DRIVERID_LM75, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm75_attach_adapter, .detach_client = lm75_detach_client, }; diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c index 9380fda7dcd1..6a524e92432e 100644 --- a/drivers/hwmon/lm77.c +++ b/drivers/hwmon/lm77.c @@ -76,7 +76,6 @@ static struct lm77_data *lm77_update_device(struct device *dev); static struct i2c_driver lm77_driver = { .owner = THIS_MODULE, .name = "lm77", - .flags = I2C_DF_NOTIFY, .attach_adapter = lm77_attach_adapter, .detach_client = lm77_detach_client, }; diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c index 78cdd506439f..18448f83a6b0 100644 --- a/drivers/hwmon/lm78.c +++ b/drivers/hwmon/lm78.c @@ -167,7 +167,6 @@ static struct i2c_driver lm78_driver = { .owner = THIS_MODULE, .name = "lm78", .id = I2C_DRIVERID_LM78, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm78_attach_adapter, .detach_client = lm78_detach_client, }; diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c index c359fdea211e..02303fa0c464 100644 --- a/drivers/hwmon/lm80.c +++ b/drivers/hwmon/lm80.c @@ -146,7 +146,6 @@ static struct i2c_driver lm80_driver = { .owner = THIS_MODULE, .name = "lm80", .id = I2C_DRIVERID_LM80, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm80_attach_adapter, .detach_client = lm80_detach_client, }; diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c index 9a70611a9f69..96cb34ea2490 100644 --- a/drivers/hwmon/lm83.c +++ b/drivers/hwmon/lm83.c @@ -127,7 +127,6 @@ static struct i2c_driver lm83_driver = { .owner = THIS_MODULE, .name = "lm83", .id = I2C_DRIVERID_LM83, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm83_attach_adapter, .detach_client = lm83_detach_client, }; diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c index 3f5544a40f3c..131ecab094ac 100644 --- a/drivers/hwmon/lm85.c +++ b/drivers/hwmon/lm85.c @@ -383,7 +383,6 @@ static struct i2c_driver lm85_driver = { .owner = THIS_MODULE, .name = "lm85", .id = I2C_DRIVERID_LM85, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm85_attach_adapter, .detach_client = lm85_detach_client, }; diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c index eeec18177861..26fd0b33beaf 100644 --- a/drivers/hwmon/lm87.c +++ b/drivers/hwmon/lm87.c @@ -164,7 +164,6 @@ static struct i2c_driver lm87_driver = { .owner = THIS_MODULE, .name = "lm87", .id = I2C_DRIVERID_LM87, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm87_attach_adapter, .detach_client = lm87_detach_client, }; diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 83cf2e1b09f5..011923b7091d 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -189,7 +189,6 @@ static struct i2c_driver lm90_driver = { .owner = THIS_MODULE, .name = "lm90", .id = I2C_DRIVERID_LM90, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm90_attach_adapter, .detach_client = lm90_detach_client, }; diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c index 7a4b3701ed1a..2005a9ee61fb 100644 --- a/drivers/hwmon/lm92.c +++ b/drivers/hwmon/lm92.c @@ -413,7 +413,6 @@ static struct i2c_driver lm92_driver = { .owner = THIS_MODULE, .name = "lm92", .id = I2C_DRIVERID_LM92, - .flags = I2C_DF_NOTIFY, .attach_adapter = lm92_attach_adapter, .detach_client = lm92_detach_client, }; diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index 69e7e125683b..d5aebef126d5 100644 --- a/drivers/hwmon/max1619.c +++ b/drivers/hwmon/max1619.c @@ -92,7 +92,6 @@ static struct max1619_data *max1619_update_device(struct device *dev); static struct i2c_driver max1619_driver = { .owner = THIS_MODULE, .name = "max1619", - .flags = I2C_DF_NOTIFY, .attach_adapter = max1619_attach_adapter, .detach_client = max1619_detach_client, }; diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index ffdb3a03e2b5..a78929f2b3d8 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c @@ -272,7 +272,6 @@ static struct i2c_driver w83781d_driver = { .owner = THIS_MODULE, .name = "w83781d", .id = I2C_DRIVERID_W83781D, - .flags = I2C_DF_NOTIFY, .attach_adapter = w83781d_attach_adapter, .detach_client = w83781d_detach_client, }; diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index 1ba072630361..6824243d90d7 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c @@ -319,7 +319,6 @@ static void w83792d_init_client(struct i2c_client *client); static struct i2c_driver w83792d_driver = { .owner = THIS_MODULE, .name = "w83792d", - .flags = I2C_DF_NOTIFY, .attach_adapter = w83792d_attach_adapter, .detach_client = w83792d_detach_client, }; diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c index f495b6378668..35172fb455d0 100644 --- a/drivers/hwmon/w83l785ts.c +++ b/drivers/hwmon/w83l785ts.c @@ -95,7 +95,6 @@ static struct i2c_driver w83l785ts_driver = { .owner = THIS_MODULE, .name = "w83l785ts", .id = I2C_DRIVERID_W83L785TS, - .flags = I2C_DF_NOTIFY, .attach_adapter = w83l785ts_attach_adapter, .detach_client = w83l785ts_detach_client, }; diff --git a/drivers/i2c/chips/ds1337.c b/drivers/i2c/chips/ds1337.c index 18228957606c..65146cbc8390 100644 --- a/drivers/i2c/chips/ds1337.c +++ b/drivers/i2c/chips/ds1337.c @@ -54,7 +54,6 @@ static int ds1337_command(struct i2c_client *client, unsigned int cmd, static struct i2c_driver ds1337_driver = { .owner = THIS_MODULE, .name = "ds1337", - .flags = I2C_DF_NOTIFY, .attach_adapter = ds1337_attach_adapter, .detach_client = ds1337_detach_client, .command = ds1337_command, diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c index da488b735abf..5a270d60b699 100644 --- a/drivers/i2c/chips/ds1374.c +++ b/drivers/i2c/chips/ds1374.c @@ -235,7 +235,6 @@ static struct i2c_driver ds1374_driver = { .owner = THIS_MODULE, .name = DS1374_DRV_NAME, .id = I2C_DRIVERID_DS1374, - .flags = I2C_DF_NOTIFY, .attach_adapter = ds1374_attach, .detach_client = ds1374_detach, }; diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index 4baf573fa04f..9bb1f8b3f38c 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c @@ -71,7 +71,6 @@ static struct i2c_driver eeprom_driver = { .owner = THIS_MODULE, .name = "eeprom", .id = I2C_DRIVERID_EEPROM, - .flags = I2C_DF_NOTIFY, .attach_adapter = eeprom_attach_adapter, .detach_client = eeprom_detach_client, }; diff --git a/drivers/i2c/chips/isp1301_omap.c b/drivers/i2c/chips/isp1301_omap.c index d2a100d77839..4f472ba66a02 100644 --- a/drivers/i2c/chips/isp1301_omap.c +++ b/drivers/i2c/chips/isp1301_omap.c @@ -1636,7 +1636,6 @@ static struct i2c_driver isp1301_driver = { .name = "isp1301_omap", .id = 1301, /* FIXME "official", i2c-ids.h */ .class = I2C_CLASS_HWMON, - .flags = I2C_DF_NOTIFY, .attach_adapter = isp1301_scan_bus, .detach_client = isp1301_detach_client, }; diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c index 3df309ae44a6..13e67836b348 100644 --- a/drivers/i2c/chips/m41t00.c +++ b/drivers/i2c/chips/m41t00.c @@ -214,7 +214,6 @@ static struct i2c_driver m41t00_driver = { .owner = THIS_MODULE, .name = M41T00_DRV_NAME, .id = I2C_DRIVERID_STM41T00, - .flags = I2C_DF_NOTIFY, .attach_adapter = m41t00_attach, .detach_client = m41t00_detach, }; diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index b376a006883c..7e61019e72dd 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c @@ -69,7 +69,6 @@ static int max6875_detach_client(struct i2c_client *client); static struct i2c_driver max6875_driver = { .owner = THIS_MODULE, .name = "max6875", - .flags = I2C_DF_NOTIFY, .attach_adapter = max6875_attach_adapter, .detach_client = max6875_detach_client, }; diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c index 59a930346229..26feb7a4f942 100644 --- a/drivers/i2c/chips/pca9539.c +++ b/drivers/i2c/chips/pca9539.c @@ -40,7 +40,6 @@ static int pca9539_detach_client(struct i2c_client *client); static struct i2c_driver pca9539_driver = { .owner = THIS_MODULE, .name = "pca9539", - .flags = I2C_DF_NOTIFY, .attach_adapter = pca9539_attach_adapter, .detach_client = pca9539_detach_client, }; diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c index c323c2de236c..2fae640cf329 100644 --- a/drivers/i2c/chips/pcf8574.c +++ b/drivers/i2c/chips/pcf8574.c @@ -68,7 +68,6 @@ static struct i2c_driver pcf8574_driver = { .owner = THIS_MODULE, .name = "pcf8574", .id = I2C_DRIVERID_PCF8574, - .flags = I2C_DF_NOTIFY, .attach_adapter = pcf8574_attach_adapter, .detach_client = pcf8574_detach_client, }; diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c index ce420a67560b..8750f71278e1 100644 --- a/drivers/i2c/chips/pcf8591.c +++ b/drivers/i2c/chips/pcf8591.c @@ -91,7 +91,6 @@ static struct i2c_driver pcf8591_driver = { .owner = THIS_MODULE, .name = "pcf8591", .id = I2C_DRIVERID_PCF8591, - .flags = I2C_DF_NOTIFY, .attach_adapter = pcf8591_attach_adapter, .detach_client = pcf8591_detach_client, }; diff --git a/drivers/i2c/chips/rtc8564.c b/drivers/i2c/chips/rtc8564.c index 26e498d921da..e586f75dd024 100644 --- a/drivers/i2c/chips/rtc8564.c +++ b/drivers/i2c/chips/rtc8564.c @@ -362,7 +362,6 @@ static struct i2c_driver rtc8564_driver = { .owner = THIS_MODULE, .name = "RTC8564", .id = I2C_DRIVERID_RTC8564, - .flags = I2C_DF_NOTIFY, .attach_adapter = rtc8564_probe, .detach_client = rtc8564_detach, .command = rtc8564_command diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index 280dd7a45db6..439bf6ceb789 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c @@ -639,7 +639,6 @@ static int __init tps65010_scan_bus(struct i2c_adapter *bus) static struct i2c_driver tps65010_driver = { .owner = THIS_MODULE, .name = "tps65010", - .flags = I2C_DF_NOTIFY, .attach_adapter = tps65010_scan_bus, .detach_client = __exit_p(tps65010_detach_client), }; diff --git a/drivers/i2c/chips/x1205.c b/drivers/i2c/chips/x1205.c index 7da366cdc18c..c5ff2cee15ae 100644 --- a/drivers/i2c/chips/x1205.c +++ b/drivers/i2c/chips/x1205.c @@ -107,7 +107,6 @@ static int x1205_command(struct i2c_client *client, unsigned int cmd, static struct i2c_driver x1205_driver = { .owner = THIS_MODULE, .name = "x1205", - .flags = I2C_DF_NOTIFY, .attach_adapter = &x1205_attach, .detach_client = &x1205_detach, }; diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 82ea1b7ec914..ad68ac00d910 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -197,7 +197,7 @@ int i2c_add_adapter(struct i2c_adapter *adap) /* inform drivers of new adapters */ list_for_each(item,&drivers) { driver = list_entry(item, struct i2c_driver, list); - if (driver->flags & I2C_DF_NOTIFY) + if (driver->attach_adapter) /* We ignore the return code; if it fails, too bad */ driver->attach_adapter(adap); } @@ -309,7 +309,7 @@ int i2c_add_driver(struct i2c_driver *driver) pr_debug("i2c-core: driver [%s] registered\n", driver->name); /* now look for instances of driver on our adapters */ - if (driver->flags & I2C_DF_NOTIFY) { + if (driver->attach_adapter) { list_for_each(item,&adapters) { adapter = list_entry(item, struct i2c_adapter, list); driver->attach_adapter(adapter); diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 8af0bd1424d2..9da51eb37c06 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -484,7 +484,6 @@ static struct i2c_driver i2cdev_driver = { .owner = THIS_MODULE, .name = "dev_driver", .id = I2C_DRIVERID_I2CDEV, - .flags = I2C_DF_NOTIFY, .attach_adapter = i2cdev_attach_adapter, .detach_adapter = i2cdev_detach_adapter, .detach_client = i2cdev_detach_client, diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index f38696622eb4..f62c16fab42b 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -173,7 +173,6 @@ detach_thermostat(struct i2c_adapter *adapter) static struct i2c_driver thermostat_driver = { .owner = THIS_MODULE, .name = "therm_adt746x", - .flags = I2C_DF_NOTIFY, .attach_adapter = attach_thermostat, .detach_adapter = detach_thermostat, }; diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 190878eef990..df00c960fc5a 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c @@ -285,7 +285,6 @@ static struct i2c_driver therm_pm72_driver = { .owner = THIS_MODULE, .name = "therm_pm72", - .flags = I2C_DF_NOTIFY, .attach_adapter = therm_pm72_attach, .detach_adapter = therm_pm72_detach, }; diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index 6aaa1df1a64e..f3bae0d00ed2 100644 --- a/drivers/macintosh/therm_windtunnel.c +++ b/drivers/macintosh/therm_windtunnel.c @@ -357,7 +357,6 @@ static struct i2c_driver g4fan_driver = { .owner = THIS_MODULE, .name = "therm_windtunnel", .id = I2C_DRIVERID_G4FAN, - .flags = I2C_DF_NOTIFY, .attach_adapter = do_attach, .detach_client = do_detach, }; diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index a0a41ad0f2b5..2392789ccf32 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c @@ -49,7 +49,6 @@ static int wf_lm75_detach(struct i2c_client *client); static struct i2c_driver wf_lm75_driver = { .owner = THIS_MODULE, .name = "wf_lm75", - .flags = I2C_DF_NOTIFY, .attach_adapter = wf_lm75_attach, .detach_client = wf_lm75_detach, }; diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index 1ca2b67aedfb..c4f2265167a2 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c @@ -502,7 +502,6 @@ static struct i2c_driver i2c_driver_adv7170 = { .name = "adv7170", /* name */ .id = I2C_DRIVERID_ADV7170, - .flags = I2C_DF_NOTIFY, .attach_adapter = adv7170_attach_adapter, .detach_client = adv7170_detach_client, diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index 173bca1e0295..4fc08b17d4d0 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c @@ -552,7 +552,6 @@ static struct i2c_driver i2c_driver_adv7175 = { .name = "adv7175", /* name */ .id = I2C_DRIVERID_ADV7175, - .flags = I2C_DF_NOTIFY, .attach_adapter = adv7175_attach_adapter, .detach_client = adv7175_detach_client, diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 3ee0afca76a7..7bba69793b78 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c @@ -627,7 +627,6 @@ static struct i2c_driver i2c_driver_bt819 = { .name = "bt819", .id = I2C_DRIVERID_BT819, - .flags = I2C_DF_NOTIFY, .attach_adapter = bt819_attach_adapter, .detach_client = bt819_detach_client, diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c index 3ca1d768bfd3..0ba8652357e2 100644 --- a/drivers/media/video/bt832.c +++ b/drivers/media/video/bt832.c @@ -233,7 +233,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "i2c bt832 driver", .id = -1, /* FIXME */ - .flags = I2C_DF_NOTIFY, .attach_adapter = bt832_probe, .detach_client = bt832_detach, .command = bt832_command, diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c index 8eb871d0e85b..4c9acd1e2c70 100644 --- a/drivers/media/video/bt856.c +++ b/drivers/media/video/bt856.c @@ -409,7 +409,6 @@ static struct i2c_driver i2c_driver_bt856 = { .name = "bt856", .id = I2C_DRIVERID_BT856, - .flags = I2C_DF_NOTIFY, .attach_adapter = bt856_attach_adapter, .detach_client = bt856_detach_client, diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index 780b352ec119..fce5d89b7b15 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c @@ -218,7 +218,6 @@ static int cs53l32a_detach(struct i2c_client *client) static struct i2c_driver i2c_driver = { .name = "cs53l32a", .id = I2C_DRIVERID_CS53L32A, - .flags = I2C_DF_NOTIFY, .attach_adapter = cs53l32a_probe, .detach_client = cs53l32a_detach, .command = cs53l32a_command, diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 5b93723a1768..c66bc147ee71 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c @@ -847,7 +847,6 @@ static struct i2c_driver i2c_driver_cx25840 = { .name = "cx25840", .id = I2C_DRIVERID_CX25840, - .flags = I2C_DF_NOTIFY, .attach_adapter = cx25840_attach_adapter, .detach_client = cx25840_detach_client, diff --git a/drivers/media/video/indycam.c b/drivers/media/video/indycam.c index deeef125eb92..3eba514cdb29 100644 --- a/drivers/media/video/indycam.c +++ b/drivers/media/video/indycam.c @@ -454,7 +454,6 @@ static struct i2c_driver i2c_driver_indycam = { .owner = THIS_MODULE, .name = "indycam", .id = I2C_DRIVERID_INDYCAM, - .flags = I2C_DF_NOTIFY, .attach_adapter = indycam_probe, .detach_client = indycam_detach, .command = indycam_command, diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 740e543311af..2e2f78a4afc8 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c @@ -280,7 +280,6 @@ static int ir_probe(struct i2c_adapter *adap); static struct i2c_driver driver = { .name = "ir remote kbd driver", .id = I2C_DRIVERID_INFRARED, - .flags = I2C_DF_NOTIFY, .attach_adapter = ir_probe, .detach_client = ir_detach, }; diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index d86f8e92e534..46328fb6fe80 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c @@ -1564,7 +1564,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "msp3400", .id = I2C_DRIVERID_MSP3400, - .flags = I2C_DF_NOTIFY, .attach_adapter = msp_probe, .detach_client = msp_detach, .command = msp_command, diff --git a/drivers/media/video/ovcamchip/ovcamchip_core.c b/drivers/media/video/ovcamchip/ovcamchip_core.c index 2de34ebf0673..390d0d6c7838 100644 --- a/drivers/media/video/ovcamchip/ovcamchip_core.c +++ b/drivers/media/video/ovcamchip/ovcamchip_core.c @@ -414,7 +414,6 @@ static struct i2c_driver driver = { .name = "ovcamchip", .id = I2C_DRIVERID_OVCAMCHIP, .class = I2C_CLASS_CAM_DIGITAL, - .flags = I2C_DF_NOTIFY, .attach_adapter = ovcamchip_attach, .detach_client = ovcamchip_detach, .command = ovcamchip_command, diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c index b8054da31ffd..9bf686989aab 100644 --- a/drivers/media/video/saa5246a.c +++ b/drivers/media/video/saa5246a.c @@ -166,7 +166,6 @@ static struct i2c_driver i2c_driver_videotext = .owner = THIS_MODULE, .name = IF_NAME, /* name */ .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ - .flags = I2C_DF_NOTIFY, .attach_adapter = saa5246a_probe, .detach_client = saa5246a_detach, .command = saa5246a_command diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c index 7ffa2e9a9bf3..811e86396030 100644 --- a/drivers/media/video/saa5249.c +++ b/drivers/media/video/saa5249.c @@ -239,7 +239,6 @@ static struct i2c_driver i2c_driver_videotext = .owner = THIS_MODULE, .name = IF_NAME, /* name */ .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ - .flags = I2C_DF_NOTIFY, .attach_adapter = saa5249_probe, .detach_client = saa5249_detach, .command = saa5249_command diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c index 923322503e8f..18a0b7143e8b 100644 --- a/drivers/media/video/saa6588.c +++ b/drivers/media/video/saa6588.c @@ -498,7 +498,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "i2c saa6588 driver", .id = -1, /* FIXME */ - .flags = I2C_DF_NOTIFY, .attach_adapter = saa6588_probe, .detach_client = saa6588_detach, .command = saa6588_command, diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index e116bdbed310..f266b35ceb35 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c @@ -591,7 +591,6 @@ static struct i2c_driver i2c_driver_saa7110 = { .name = "saa7110", .id = I2C_DRIVERID_SAA7110, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa7110_attach_adapter, .detach_client = saa7110_detach_client, diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c index fe8a5e453969..687beaf11adc 100644 --- a/drivers/media/video/saa7111.c +++ b/drivers/media/video/saa7111.c @@ -594,7 +594,6 @@ static struct i2c_driver i2c_driver_saa7111 = { .name = "saa7111", .id = I2C_DRIVERID_SAA7111A, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa7111_attach_adapter, .detach_client = saa7111_detach_client, diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index d9f50e2f7b92..4748cf0598c0 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c @@ -1208,7 +1208,6 @@ static struct i2c_driver i2c_driver_saa7114 = { .name = "saa7114", .id = I2C_DRIVERID_SAA7114, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa7114_attach_adapter, .detach_client = saa7114_detach_client, diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index e717e30d8187..b1079de938b7 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -1356,7 +1356,6 @@ static int saa7115_detach(struct i2c_client *client) static struct i2c_driver i2c_driver_saa7115 = { .name = "saa7115", .id = I2C_DRIVERID_SAA711X, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa7115_probe, .detach_client = saa7115_detach, .command = saa7115_command, diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c index 31f7b950b01c..734a70919080 100644 --- a/drivers/media/video/saa711x.c +++ b/drivers/media/video/saa711x.c @@ -569,7 +569,6 @@ static struct i2c_driver i2c_driver_saa711x = { .name = "saa711x", .id = I2C_DRIVERID_SAA711X, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa711x_attach_adapter, .detach_client = saa711x_detach_client, diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index c36f014f1fdf..a2fab9837507 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c @@ -821,7 +821,6 @@ static int saa7127_detach(struct i2c_client *client) static struct i2c_driver i2c_driver_saa7127 = { .name = "saa7127", .id = I2C_DRIVERID_SAA7127, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa7127_probe, .detach_client = saa7127_detach, .command = saa7127_command, diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index a61d24f588f7..6fc298e0a03a 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c @@ -600,7 +600,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "i2c saa6752hs MPEG encoder", .id = I2C_DRIVERID_SAA6752HS, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa6752hs_probe, .detach_client = saa6752hs_detach, .command = saa6752hs_command, diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index 132aa7943c16..e24aa16f2d8c 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c @@ -491,7 +491,6 @@ static struct i2c_driver i2c_driver_saa7185 = { .name = "saa7185", /* name */ .id = I2C_DRIVERID_SAA7185B, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa7185_attach_adapter, .detach_client = saa7185_detach_client, diff --git a/drivers/media/video/saa7191.c b/drivers/media/video/saa7191.c index cbca896e8cfa..6be98fc0fe24 100644 --- a/drivers/media/video/saa7191.c +++ b/drivers/media/video/saa7191.c @@ -791,7 +791,6 @@ static struct i2c_driver i2c_driver_saa7191 = { .owner = THIS_MODULE, .name = "saa7191", .id = I2C_DRIVERID_SAA7191, - .flags = I2C_DF_NOTIFY, .attach_adapter = saa7191_probe, .detach_client = saa7191_detach, .command = saa7191_command diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c index d32737dd2142..239a58666a12 100644 --- a/drivers/media/video/tda7432.c +++ b/drivers/media/video/tda7432.c @@ -504,7 +504,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "i2c tda7432 driver", .id = I2C_DRIVERID_TDA7432, - .flags = I2C_DF_NOTIFY, .attach_adapter = tda7432_probe, .detach_client = tda7432_detach, .command = tda7432_command, diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index 1794686612c6..f29fb507075d 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c @@ -224,7 +224,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "tda9840", .id = I2C_DRIVERID_TDA9840, - .flags = I2C_DF_NOTIFY, .attach_adapter = attach, .detach_client = detach, .command = command, diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c index a5e37dc91f39..d053b6445502 100644 --- a/drivers/media/video/tda9875.c +++ b/drivers/media/video/tda9875.c @@ -375,7 +375,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "i2c tda9875 driver", .id = I2C_DRIVERID_TDA9875, - .flags = I2C_DF_NOTIFY, .attach_adapter = tda9875_probe, .detach_client = tda9875_detach, .command = tda9875_command, diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 2f2414e90e8b..049b44e0767b 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -822,7 +822,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "i2c tda9887 driver", .id = -1, /* FIXME */ - .flags = I2C_DF_NOTIFY, .attach_adapter = tda9887_probe, .detach_client = tda9887_detach, .command = tda9887_command, diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index ee3688348b66..96d88ce60c98 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c @@ -193,7 +193,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "tea6415c", .id = I2C_DRIVERID_TEA6415C, - .flags = I2C_DF_NOTIFY, .attach_adapter = attach, .detach_client = detach, .command = command, diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index 17975c19da5e..fd417de95847 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c @@ -170,7 +170,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "tea6420", .id = I2C_DRIVERID_TEA6420, - .flags = I2C_DF_NOTIFY, .attach_adapter = attach, .detach_client = detach, .command = command, diff --git a/drivers/media/video/tuner-3036.c b/drivers/media/video/tuner-3036.c index 79203595b9c1..3505cec2e65a 100644 --- a/drivers/media/video/tuner-3036.c +++ b/drivers/media/video/tuner-3036.c @@ -178,7 +178,6 @@ i2c_driver_tuner = .owner = THIS_MODULE, .name = "sab3036", .id = I2C_DRIVERID_SAB3036, - .flags = I2C_DF_NOTIFY, .attach_adapter = tuner_probe, .detach_client = tuner_detach, .command = tuner_command diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index e58abdfcaab8..3c75121f6383 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -745,7 +745,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "tuner", .id = I2C_DRIVERID_TUNER, - .flags = I2C_DF_NOTIFY, .attach_adapter = tuner_probe, .detach_client = tuner_detach, .command = tuner_command, diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 5b20e8177cad..3565f35be7a1 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c @@ -1705,7 +1705,6 @@ static struct i2c_driver driver = { .owner = THIS_MODULE, .name = "generic i2c audio driver", .id = I2C_DRIVERID_TVAUDIO, - .flags = I2C_DF_NOTIFY, .attach_adapter = chip_probe, .detach_client = chip_detach, .command = chip_command, diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 5ac235365dd8..195bc51d4576 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c @@ -782,7 +782,6 @@ static struct i2c_driver i2c_driver_tveeprom = { .owner = THIS_MODULE, .name = "tveeprom", .id = I2C_DRIVERID_TVEEPROM, - .flags = I2C_DF_NOTIFY, .attach_adapter = tveeprom_attach_adapter, .detach_client = tveeprom_detach_client, .command = tveeprom_command, diff --git a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c index 5897e5d4d3d2..936e01d2c785 100644 --- a/drivers/media/video/tvmixer.c +++ b/drivers/media/video/tvmixer.c @@ -232,7 +232,6 @@ static struct i2c_driver driver = { #endif .name = "tv card mixer driver", .id = I2C_DRIVERID_TVMIXER, - .flags = I2C_DF_NOTIFY, .detach_adapter = tvmixer_adapters, .attach_adapter = tvmixer_adapters, .detach_client = tvmixer_clients, diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 97431e26d229..4f3ee2091611 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -806,7 +806,6 @@ static struct i2c_driver driver = { /* FIXME */ .id = I2C_DRIVERID_SAA7110, - .flags = I2C_DF_NOTIFY, .attach_adapter = tvp5150_attach_adapter, .detach_client = tvp5150_detach_client, diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c index 137b58f2c666..c66d28505bcd 100644 --- a/drivers/media/video/vpx3220.c +++ b/drivers/media/video/vpx3220.c @@ -726,7 +726,6 @@ static struct i2c_driver vpx3220_i2c_driver = { .name = "vpx3220", .id = I2C_DRIVERID_VPX3220, - .flags = I2C_DF_NOTIFY, .attach_adapter = vpx3220_attach_adapter, .detach_client = vpx3220_detach_client, diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index a6936ad74fcf..7b07717a3c67 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c @@ -236,7 +236,6 @@ static struct i2c_driver i2c_driver = { .name = "wm8775", .id = I2C_DRIVERID_WM8775, - .flags = I2C_DF_NOTIFY, .attach_adapter = wm8775_probe, .detach_client = wm8775_detach, diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c index ad60bbb16cdf..78994c5fe932 100644 --- a/drivers/video/matrox/matroxfb_maven.c +++ b/drivers/video/matrox/matroxfb_maven.c @@ -1296,7 +1296,6 @@ static struct i2c_driver maven_driver={ .owner = THIS_MODULE, .name = "maven", .id = I2C_DRIVERID_MGATVO, - .flags = I2C_DF_NOTIFY, .attach_adapter = maven_attach_adapter, .detach_client = maven_detach_client, .command = maven_command, diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 0316ba1294ca..99399fadf13f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -251,7 +251,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) } /*flags for the driver struct: */ -#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ diff --git a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c index 533895eba0eb..3402a663d07f 100644 --- a/sound/oss/dmasound/dac3550a.c +++ b/sound/oss/dmasound/dac3550a.c @@ -44,7 +44,6 @@ struct i2c_driver daca_driver = { .owner = THIS_MODULE, .name = "DAC3550A driver V " DACA_VERSION, .id = I2C_DRIVERID_DACA, - .flags = I2C_DF_NOTIFY, .attach_adapter = daca_attach_adapter, .detach_client = daca_detach_client, }; diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c index d36a1fe2fcf3..7e3d517af4b9 100644 --- a/sound/oss/dmasound/tas_common.c +++ b/sound/oss/dmasound/tas_common.c @@ -49,7 +49,6 @@ static int tas_detach_client(struct i2c_client *); struct i2c_driver tas_driver = { .owner = THIS_MODULE, .name = "tas", - .flags = I2C_DF_NOTIFY, .attach_adapter = tas_attach_adapter, .detach_client = tas_detach_client, }; diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c index 097fbcfc5d45..fd8e2e6062f6 100644 --- a/sound/ppc/keywest.c +++ b/sound/ppc/keywest.c @@ -43,7 +43,6 @@ static int keywest_detach_client(struct i2c_client *client); struct i2c_driver keywest_driver = { .name = "PMac Keywest Audio", .id = I2C_DRIVERID_KEYWEST, - .flags = I2C_DF_NOTIFY, .attach_adapter = &keywest_attach_adapter, .detach_client = &keywest_detach_client, }; -- cgit v1.2.3 From 5d7b851dcced3611e4a4432308618b1ed1a9fc31 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 27 Nov 2005 08:57:10 +0100 Subject: [PATCH] i2c: Drop i2c_driver.flags, 3 of 3 The flags member of the i2c_driver structure is no more used. Drop it. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 99399fadf13f..3c16a8fb95f4 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -112,7 +112,6 @@ struct i2c_driver { char name[32]; int id; unsigned int class; - unsigned int flags; /* div., see below */ /* Notifies the driver that a new bus has appeared. This routine * can be used by the driver to test if the bus meets its conditions @@ -250,8 +249,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) dev_set_drvdata (&dev->dev, data); } -/*flags for the driver struct: */ - /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ #define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */ -- cgit v1.2.3 From cb748fb20186d4b345c68a7f580429f379fdd268 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 20:58:35 +0100 Subject: [PATCH] i2c: Rework client usage count, 1 of 3 No i2c client uses the I2C_CLIENT_ALLOW_MULTIPLE_USE flag, drop it. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/i2c-core.c | 4 +--- include/linux/i2c.h | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index ad68ac00d910..2f0bc9529376 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -500,9 +500,7 @@ int i2c_use_client(struct i2c_client *client) return ret; if (client->flags & I2C_CLIENT_ALLOW_USE) { - if (client->flags & I2C_CLIENT_ALLOW_MULTIPLE_USE) - client->usage_count++; - else if (client->usage_count > 0) + if (client->usage_count > 0) goto busy; else client->usage_count++; diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 3c16a8fb95f4..4487c5189747 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -251,8 +251,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ -#define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */ - /* on an i2c_client */ #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ /* Must equal I2C_M_TEN below */ -- cgit v1.2.3 From cde7859bda0d1124392b44e50aa11df99707e1d9 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 21:00:54 +0100 Subject: [PATCH] i2c: Rework client usage count, 2 of 3 Make I2C_CLIENT_ALLOW_USE the default for all i2c clients. It doesn't hurt if the usage count is actually never used for any given driver, and allows for nice code simplifications in i2c-core. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-pxa/akita-ioexp.c | 1 - drivers/i2c/chips/rtc8564.c | 1 - drivers/i2c/i2c-core.c | 28 ++++++++++------------------ drivers/media/video/adv7170.c | 1 - drivers/media/video/adv7175.c | 1 - drivers/media/video/bt819.c | 1 - drivers/media/video/bt832.c | 1 - drivers/media/video/bt856.c | 1 - drivers/media/video/cs53l32a.c | 1 - drivers/media/video/cx25840/cx25840-core.c | 1 - drivers/media/video/em28xx/em28xx-i2c.c | 1 - drivers/media/video/msp3400.c | 1 - drivers/media/video/saa6588.c | 1 - drivers/media/video/saa7110.c | 1 - drivers/media/video/saa7111.c | 1 - drivers/media/video/saa7114.c | 1 - drivers/media/video/saa7115.c | 1 - drivers/media/video/saa711x.c | 1 - drivers/media/video/saa7127.c | 1 - drivers/media/video/saa7134/saa6752hs.c | 1 - drivers/media/video/saa7185.c | 1 - drivers/media/video/tda9887.c | 1 - drivers/media/video/tuner-core.c | 1 - drivers/media/video/tvaudio.c | 1 - drivers/media/video/tveeprom.c | 1 - drivers/media/video/tvp5150.c | 1 - drivers/media/video/vpx3220.c | 1 - drivers/media/video/wm8775.c | 1 - include/linux/i2c.h | 1 - 29 files changed, 10 insertions(+), 46 deletions(-) (limited to 'include') diff --git a/arch/arm/mach-pxa/akita-ioexp.c b/arch/arm/mach-pxa/akita-ioexp.c index 440ebb3c3db1..b6bff550c8e9 100644 --- a/arch/arm/mach-pxa/akita-ioexp.c +++ b/arch/arm/mach-pxa/akita-ioexp.c @@ -133,7 +133,6 @@ static struct i2c_driver max7310_i2c_driver = { static struct i2c_client max7310_template = { name: "akita-max7310", - flags: I2C_CLIENT_ALLOW_USE, driver: &max7310_i2c_driver, }; diff --git a/drivers/i2c/chips/rtc8564.c b/drivers/i2c/chips/rtc8564.c index e586f75dd024..07494d394381 100644 --- a/drivers/i2c/chips/rtc8564.c +++ b/drivers/i2c/chips/rtc8564.c @@ -155,7 +155,6 @@ static int rtc8564_attach(struct i2c_adapter *adap, int addr, int kind) strlcpy(new_client->name, "RTC8564", I2C_NAME_SIZE); i2c_set_clientdata(new_client, d); - new_client->flags = I2C_CLIENT_ALLOW_USE; new_client->addr = addr; new_client->adapter = adap; new_client->driver = &rtc8564_driver; diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 2f0bc9529376..d16b4998c4c2 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -419,8 +419,7 @@ int i2c_attach_client(struct i2c_client *client) } } - if (client->flags & I2C_CLIENT_ALLOW_USE) - client->usage_count = 0; + client->usage_count = 0; client->dev.parent = &client->adapter->dev; client->dev.driver = &client->driver->driver; @@ -443,8 +442,7 @@ int i2c_detach_client(struct i2c_client *client) struct i2c_adapter *adapter = client->adapter; int res = 0; - if ((client->flags & I2C_CLIENT_ALLOW_USE) - && (client->usage_count > 0)) { + if (client->usage_count > 0) { dev_warn(&client->dev, "Client [%s] still busy, " "can't detach\n", client->name); return -EBUSY; @@ -499,12 +497,9 @@ int i2c_use_client(struct i2c_client *client) if (ret) return ret; - if (client->flags & I2C_CLIENT_ALLOW_USE) { - if (client->usage_count > 0) - goto busy; - else - client->usage_count++; - } + if (client->usage_count > 0) + goto busy; + client->usage_count++; return 0; busy: @@ -514,16 +509,13 @@ int i2c_use_client(struct i2c_client *client) int i2c_release_client(struct i2c_client *client) { - if(client->flags & I2C_CLIENT_ALLOW_USE) { - if(client->usage_count>0) - client->usage_count--; - else { - pr_debug("i2c-core: %s used one too many times\n", - __FUNCTION__); - return -EPERM; - } + if (!client->usage_count) { + pr_debug("i2c-core: %s used one too many times\n", + __FUNCTION__); + return -EPERM; } + client->usage_count--; i2c_dec_use_client(client); return 0; diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index c4f2265167a2..622b1619a7e3 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c @@ -420,7 +420,6 @@ adv7170_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_adv7170; - client->flags = I2C_CLIENT_ALLOW_USE; if ((client->addr == I2C_ADV7170 >> 1) || (client->addr == (I2C_ADV7170 >> 1) + 1)) { dname = adv7170_name; diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index 4fc08b17d4d0..d4859b445715 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c @@ -470,7 +470,6 @@ adv7175_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_adv7175; - client->flags = I2C_CLIENT_ALLOW_USE; if ((client->addr == I2C_ADV7175 >> 1) || (client->addr == (I2C_ADV7175 >> 1) + 1)) { dname = adv7175_name; diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 7bba69793b78..741e59af0991 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c @@ -535,7 +535,6 @@ bt819_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_bt819; - client->flags = I2C_CLIENT_ALLOW_USE; decoder = kmalloc(sizeof(struct bt819), GFP_KERNEL); if (decoder == NULL) { diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c index 0ba8652357e2..4ed13860b523 100644 --- a/drivers/media/video/bt832.c +++ b/drivers/media/video/bt832.c @@ -240,7 +240,6 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { .name = "bt832", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c index 4c9acd1e2c70..d4bba8efac69 100644 --- a/drivers/media/video/bt856.c +++ b/drivers/media/video/bt856.c @@ -323,7 +323,6 @@ bt856_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_bt856; - client->flags = I2C_CLIENT_ALLOW_USE; strlcpy(I2C_NAME(client), "bt856", sizeof(I2C_NAME(client))); encoder = kmalloc(sizeof(struct bt856), GFP_KERNEL); diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index fce5d89b7b15..f442ce3ba74b 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c @@ -154,7 +154,6 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind) client->addr = address; client->adapter = adapter; client->driver = &i2c_driver; - client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name) - 1, "cs53l32a"); cs53l32a_info("chip found @ 0x%x (%s)\n", address << 1, adapter->name); diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index c66bc147ee71..0b278abe879d 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c @@ -773,7 +773,6 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_cx25840; - client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name) - 1, "cx25840"); cx25840_dbg("detecting cx25840 client on address 0x%x\n", address << 1); diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c index 7f5603054f02..d14bcf4ceaea 100644 --- a/drivers/media/video/em28xx/em28xx-i2c.c +++ b/drivers/media/video/em28xx/em28xx-i2c.c @@ -497,7 +497,6 @@ static struct i2c_adapter em28xx_adap_template = { static struct i2c_client em28xx_client_template = { .name = "em28xx internal", - .flags = I2C_CLIENT_ALLOW_USE, }; /* ----------------------------------------------------------- */ diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 46328fb6fe80..c5e8ad3aac4a 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c @@ -1576,7 +1576,6 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { .name = "(unset)", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c index 18a0b7143e8b..3d4076ca67c3 100644 --- a/drivers/media/video/saa6588.c +++ b/drivers/media/video/saa6588.c @@ -505,7 +505,6 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { .name = "saa6588", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index f266b35ceb35..8affa63c8b24 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c @@ -501,7 +501,6 @@ saa7110_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_saa7110; - client->flags = I2C_CLIENT_ALLOW_USE; strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); decoder = kmalloc(sizeof(struct saa7110), GFP_KERNEL); diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c index 687beaf11adc..2b2204564514 100644 --- a/drivers/media/video/saa7111.c +++ b/drivers/media/video/saa7111.c @@ -518,7 +518,6 @@ saa7111_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_saa7111; - client->flags = I2C_CLIENT_ALLOW_USE; strlcpy(I2C_NAME(client), "saa7111", sizeof(I2C_NAME(client))); decoder = kmalloc(sizeof(struct saa7111), GFP_KERNEL); diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index 4748cf0598c0..285f6c7a8f71 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c @@ -859,7 +859,6 @@ saa7114_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_saa7114; - client->flags = I2C_CLIENT_ALLOW_USE; strlcpy(I2C_NAME(client), "saa7114", sizeof(I2C_NAME(client))); decoder = kmalloc(sizeof(struct saa7114), GFP_KERNEL); diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index b1079de938b7..79aadd2d408f 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -1270,7 +1270,6 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_saa7115; - client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name) - 1, "saa7115"); saa7115_dbg("detecting saa7115 client on address 0x%x\n", address << 1); diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c index 734a70919080..44bfc047704c 100644 --- a/drivers/media/video/saa711x.c +++ b/drivers/media/video/saa711x.c @@ -494,7 +494,6 @@ saa711x_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_saa711x; - client->flags = I2C_CLIENT_ALLOW_USE; strlcpy(I2C_NAME(client), "saa711x", sizeof(I2C_NAME(client))); decoder = kmalloc(sizeof(struct saa711x), GFP_KERNEL); if (decoder == NULL) { diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index a2fab9837507..1f4b41599445 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c @@ -719,7 +719,6 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_saa7127; - client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name) - 1, "saa7127"); saa7127_dbg("detecting saa7127 client on address 0x%x\n", address << 1); diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index 6fc298e0a03a..68206060c92d 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c @@ -608,7 +608,6 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { .name = "saa6752hs", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index e24aa16f2d8c..9f37585d3f73 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c @@ -415,7 +415,6 @@ saa7185_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_saa7185; - client->flags = I2C_CLIENT_ALLOW_USE; strlcpy(I2C_NAME(client), "saa7185", sizeof(I2C_NAME(client))); encoder = kmalloc(sizeof(struct saa7185), GFP_KERNEL); diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 049b44e0767b..324f61bf714e 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -833,7 +833,6 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { .name = "tda9887", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 3c75121f6383..6328f0954e70 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -755,7 +755,6 @@ static struct i2c_driver driver = { }; static struct i2c_client client_template = { .name = "(tuner unset)", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 3565f35be7a1..4f1f339283e0 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c @@ -1713,7 +1713,6 @@ static struct i2c_driver driver = { static struct i2c_client client_template = { .name = "(unset)", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 195bc51d4576..d833b651073a 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c @@ -751,7 +751,6 @@ tveeprom_detect_client(struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &i2c_driver_tveeprom; - client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name), "tveeprom"); i2c_attach_client(client); diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 4f3ee2091611..3734554fc73b 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -714,7 +714,6 @@ static struct i2c_driver driver; static struct i2c_client client_template = { .name = "(unset)", - .flags = I2C_CLIENT_ALLOW_USE, .driver = &driver, }; diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c index c66d28505bcd..54bc888c3891 100644 --- a/drivers/media/video/vpx3220.c +++ b/drivers/media/video/vpx3220.c @@ -631,7 +631,6 @@ vpx3220_detect_client (struct i2c_adapter *adapter, client->addr = address; client->adapter = adapter; client->driver = &vpx3220_i2c_driver; - client->flags = I2C_CLIENT_ALLOW_USE; /* Check for manufacture ID and part number */ if (kind < 0) { diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index 7b07717a3c67..527c2591749a 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c @@ -168,7 +168,6 @@ static int wm8775_attach(struct i2c_adapter *adapter, int address, int kind) client->addr = address; client->adapter = adapter; client->driver = &i2c_driver; - client->flags = I2C_CLIENT_ALLOW_USE; snprintf(client->name, sizeof(client->name) - 1, "wm8775"); wm8775_info("chip found @ 0x%x (%s)\n", address << 1, adapter->name); diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 4487c5189747..8b4d4695de0e 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -250,7 +250,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) } /*flags for the client struct: */ -#define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ /* Must equal I2C_M_TEN below */ -- cgit v1.2.3 From cf02df770228350254251fde520007a2709db785 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 21:03:41 +0100 Subject: [PATCH] i2c: Rework client usage count, 3 of 3 Do not limit the usage count of i2c clients to 1. In other words, change the client usage count behavior from the old I2C_CLIENT_ALLOW_USE to the old I2C_CLIENT_ALLOW_MULTIPLE_USE. The rationale is that no driver actually needs the limiting behavior, and the unlimiting behavior is slightly easier to implement. Update the documentation to reflect this change. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- Documentation/i2c/porting-clients | 1 + drivers/i2c/i2c-core.c | 5 ----- include/linux/i2c.h | 4 +--- 3 files changed, 2 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index 64c610bf2fbc..6b07f23039d2 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients @@ -92,6 +92,7 @@ Technical changes: Drop client->id. Drop any 24RF08 corruption prevention you find, as this is now done at the i2c-core level, and doing it twice voids it. + Don't add I2C_CLIENT_ALLOW_USE to client->flags, it's the default now. * [Init] Limits must not be set by the driver (can be done later in user-space). Chip should not be reset default (although a module diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index d16b4998c4c2..a1c5dff85431 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -497,14 +497,9 @@ int i2c_use_client(struct i2c_client *client) if (ret) return ret; - if (client->usage_count > 0) - goto busy; client->usage_count++; return 0; - busy: - i2c_dec_use_client(client); - return -EBUSY; } int i2c_release_client(struct i2c_client *client) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 8b4d4695de0e..85c517a9b05b 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -307,9 +307,7 @@ extern struct i2c_client *i2c_get_client(int driver_id, int adapter_id, extern struct i2c_client *i2c_get_client(int,int,struct i2c_client *); to make sure that client-struct is valid and that it is okay to access the i2c-client. - returns -EACCES if client doesn't allow use (default) - returns -EBUSY if client doesn't allow multiple use (default) and - usage_count >0 */ + returns -ENODEV if client has gone in the meantime */ extern int i2c_use_client(struct i2c_client *); extern int i2c_release_client(struct i2c_client *); -- cgit v1.2.3 From 482c788ded0aa9710722eaf9cf60886d3b923218 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 21:06:08 +0100 Subject: [PATCH] i2c: i2c_get_client is gone The i2c_get_client function doesn't exist anymore, so we shouldn't have a definition for it in i2c.h. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 85c517a9b05b..a9cea62fd486 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -296,17 +296,8 @@ extern int i2c_del_driver(struct i2c_driver *); extern int i2c_attach_client(struct i2c_client *); extern int i2c_detach_client(struct i2c_client *); -/* New function: This is to get an i2c_client-struct for controlling the - client either by using i2c_control-function or having the - client-module export functions that can be used with the i2c_client - -struct. */ -extern struct i2c_client *i2c_get_client(int driver_id, int adapter_id, - struct i2c_client *prev); - -/* Should be used with new function - extern struct i2c_client *i2c_get_client(int,int,struct i2c_client *); - to make sure that client-struct is valid and that it is okay to access - the i2c-client. +/* Should be used to make sure that client-struct is valid and that it + is okay to access the i2c-client. returns -ENODEV if client has gone in the meantime */ extern int i2c_use_client(struct i2c_client *); extern int i2c_release_client(struct i2c_client *); -- cgit v1.2.3 From 35d8b2e6b8e86b0d5126f36613b5202d4eb978b6 Mon Sep 17 00:00:00 2001 From: Laurent Riffard Date: Sat, 26 Nov 2005 20:34:05 +0100 Subject: [PATCH] i2c: Drop i2c_driver.{owner,name}, 1 of 11 We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the core of the i2c drivers: it removes .name and .owner fields from the struct i2c_device and modify various functions to use struct device fields instead. Signed-off-by: Laurent Riffard Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-isa.c | 4 +--- drivers/i2c/i2c-core.c | 22 +++++++++++----------- drivers/i2c/i2c-dev.c | 6 ++++-- include/linux/i2c.h | 5 +++-- 4 files changed, 19 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c index 03672c9ca409..9f93fb85d06e 100644 --- a/drivers/i2c/busses/i2c-isa.c +++ b/drivers/i2c/busses/i2c-isa.c @@ -92,8 +92,6 @@ int i2c_isa_add_driver(struct i2c_driver *driver) int res; /* Add the driver to the list of i2c drivers in the driver core */ - driver->driver.name = driver->name; - driver->driver.owner = driver->owner; driver->driver.bus = &i2c_bus_type; driver->driver.probe = i2c_isa_device_probe; driver->driver.remove = i2c_isa_device_remove; @@ -124,7 +122,7 @@ int i2c_isa_del_driver(struct i2c_driver *driver) if ((res = driver->detach_client(client))) { dev_err(&isa_adapter.dev, "Failed, driver " "%s not unregistered!\n", - driver->name); + driver->driver.name); return res; } } diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index a1c5dff85431..4ce5f0f32fba 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -235,7 +235,8 @@ int i2c_del_adapter(struct i2c_adapter *adap) if (driver->detach_adapter) if ((res = driver->detach_adapter(adap))) { dev_err(&adap->dev, "detach_adapter failed " - "for driver [%s]\n", driver->name); + "for driver [%s]\n", + driver->driver.name); goto out_unlock; } } @@ -295,8 +296,6 @@ int i2c_add_driver(struct i2c_driver *driver) down(&core_lists); /* add the driver to the list of i2c drivers in the driver core */ - driver->driver.owner = driver->owner; - driver->driver.name = driver->name; driver->driver.bus = &i2c_bus_type; driver->driver.probe = i2c_device_probe; driver->driver.remove = i2c_device_remove; @@ -306,7 +305,7 @@ int i2c_add_driver(struct i2c_driver *driver) goto out_unlock; list_add_tail(&driver->list,&drivers); - pr_debug("i2c-core: driver [%s] registered\n", driver->name); + pr_debug("i2c-core: driver [%s] registered\n", driver->driver.name); /* now look for instances of driver on our adapters */ if (driver->attach_adapter) { @@ -344,7 +343,8 @@ int i2c_del_driver(struct i2c_driver *driver) if (driver->detach_adapter) { if ((res = driver->detach_adapter(adap))) { dev_err(&adap->dev, "detach_adapter failed " - "for driver [%s]\n", driver->name); + "for driver [%s]\n", + driver->driver.name); goto out_unlock; } } else { @@ -368,7 +368,7 @@ int i2c_del_driver(struct i2c_driver *driver) driver_unregister(&driver->driver); list_del(&driver->list); - pr_debug("i2c-core: driver [%s] unregistered\n", driver->name); + pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name); out_unlock: up(&core_lists); @@ -473,10 +473,10 @@ int i2c_detach_client(struct i2c_client *client) static int i2c_inc_use_client(struct i2c_client *client) { - if (!try_module_get(client->driver->owner)) + if (!try_module_get(client->driver->driver.owner)) return -ENODEV; if (!try_module_get(client->adapter->owner)) { - module_put(client->driver->owner); + module_put(client->driver->driver.owner); return -ENODEV; } @@ -485,7 +485,7 @@ static int i2c_inc_use_client(struct i2c_client *client) static void i2c_dec_use_client(struct i2c_client *client) { - module_put(client->driver->owner); + module_put(client->driver->driver.owner); module_put(client->adapter->owner); } @@ -524,14 +524,14 @@ void i2c_clients_command(struct i2c_adapter *adap, unsigned int cmd, void *arg) down(&adap->clist_lock); list_for_each(item,&adap->clients) { client = list_entry(item, struct i2c_client, list); - if (!try_module_get(client->driver->owner)) + if (!try_module_get(client->driver->driver.owner)) continue; if (NULL != client->driver->command) { up(&adap->clist_lock); client->driver->command(client,cmd,arg); down(&adap->clist_lock); } - module_put(client->driver->owner); + module_put(client->driver->driver.owner); } up(&adap->clist_lock); } diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 9da51eb37c06..9715217a0343 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -481,8 +481,10 @@ static int i2cdev_command(struct i2c_client *client, unsigned int cmd, } static struct i2c_driver i2cdev_driver = { - .owner = THIS_MODULE, - .name = "dev_driver", + .driver = { + .owner = THIS_MODULE, + .name = "dev_driver", + }, .id = I2C_DRIVERID_I2CDEV, .attach_adapter = i2cdev_attach_adapter, .detach_adapter = i2cdev_detach_adapter, diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a9cea62fd486..75aa18e865da 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -105,11 +105,12 @@ extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, * A driver is capable of handling one or more physical devices present on * I2C adapters. This information is used to inform the driver of adapter * events. + * + * The driver.owner field should be set to the module owner of this driver. + * The driver.name field should be set to the name of this driver. */ struct i2c_driver { - struct module *owner; - char name[32]; int id; unsigned int class; -- cgit v1.2.3 From 604f28e2b8d34cbaf08f0351374645f161335a82 Mon Sep 17 00:00:00 2001 From: Laurent Riffard Date: Sat, 26 Nov 2005 20:43:39 +0100 Subject: [PATCH] i2c: Drop i2c_driver.{owner,name}, 5 of 11 We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the drivers/media/video and usb/media drivers. Signed-off-by: Laurent Riffard Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/media/video/adv7170.c | 6 ++++-- drivers/media/video/adv7175.c | 6 ++++-- drivers/media/video/bt819.c | 6 ++++-- drivers/media/video/bt832.c | 6 ++++-- drivers/media/video/bt856.c | 6 ++++-- drivers/media/video/bttv-i2c.c | 2 +- drivers/media/video/cs53l32a.c | 13 ++++++++----- drivers/media/video/cx25840/cx25840-core.c | 6 ++++-- drivers/media/video/cx25840/cx25840.h | 7 ++++--- drivers/media/video/cx88/cx88-i2c.c | 2 +- drivers/media/video/indycam.c | 6 ++++-- drivers/media/video/ir-kbd-i2c.c | 5 ++++- drivers/media/video/msp3400.c | 19 +++++++++++-------- drivers/media/video/ovcamchip/ovcamchip_core.c | 6 ++++-- drivers/media/video/saa5246a.c | 6 ++++-- drivers/media/video/saa5249.c | 6 ++++-- drivers/media/video/saa6588.c | 6 ++++-- drivers/media/video/saa7110.c | 6 ++++-- drivers/media/video/saa7111.c | 6 ++++-- drivers/media/video/saa7114.c | 6 ++++-- drivers/media/video/saa7115.c | 13 ++++++++----- drivers/media/video/saa711x.c | 6 ++++-- drivers/media/video/saa7127.c | 16 ++++++++++------ drivers/media/video/saa7134/saa6752hs.c | 6 ++++-- drivers/media/video/saa7134/saa7134-i2c.c | 4 ++-- drivers/media/video/saa7185.c | 6 ++++-- drivers/media/video/saa7191.c | 6 ++++-- drivers/media/video/tda7432.c | 6 ++++-- drivers/media/video/tda9840.c | 6 ++++-- drivers/media/video/tda9875.c | 6 ++++-- drivers/media/video/tda9887.c | 4 ++-- drivers/media/video/tea6415c.c | 6 ++++-- drivers/media/video/tea6420.c | 6 ++++-- drivers/media/video/tuner-3036.c | 6 ++++-- drivers/media/video/tuner-core.c | 6 +++--- drivers/media/video/tvaudio.c | 6 ++++-- drivers/media/video/tveeprom.c | 6 ++++-- drivers/media/video/tvmixer.c | 8 ++++++-- drivers/media/video/tvp5150.c | 6 ++++-- drivers/media/video/vpx3220.c | 6 ++++-- drivers/media/video/wm8775.c | 10 ++++++---- drivers/media/video/zoran_driver.c | 14 +++++++------- drivers/usb/media/w9968cf.c | 4 ++-- include/media/tuner.h | 7 ++++--- 44 files changed, 191 insertions(+), 111 deletions(-) (limited to 'include') diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index 622b1619a7e3..c5f1c6b681bd 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c @@ -497,8 +497,10 @@ adv7170_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_adv7170 = { - .owner = THIS_MODULE, - .name = "adv7170", /* name */ + .driver = { + .owner = THIS_MODULE, + .name = "adv7170", /* name */ + }, .id = I2C_DRIVERID_ADV7170, diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index d4859b445715..33158aa734d3 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c @@ -547,8 +547,10 @@ adv7175_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_adv7175 = { - .owner = THIS_MODULE, - .name = "adv7175", /* name */ + .driver = { + .owner = THIS_MODULE, + .name = "adv7175", /* name */ + }, .id = I2C_DRIVERID_ADV7175, diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 741e59af0991..5868bbb73a09 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c @@ -622,8 +622,10 @@ bt819_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_bt819 = { - .owner = THIS_MODULE, - .name = "bt819", + .driver = { + .owner = THIS_MODULE, + .name = "bt819", + }, .id = I2C_DRIVERID_BT819, diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c index 4ed13860b523..347eb711fc06 100644 --- a/drivers/media/video/bt832.c +++ b/drivers/media/video/bt832.c @@ -230,8 +230,10 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "i2c bt832 driver", + .driver = { + .owner = THIS_MODULE, + .name = "i2c bt832 driver", + }, .id = -1, /* FIXME */ .attach_adapter = bt832_probe, .detach_client = bt832_detach, diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c index d4bba8efac69..207525aa156e 100644 --- a/drivers/media/video/bt856.c +++ b/drivers/media/video/bt856.c @@ -404,8 +404,10 @@ bt856_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_bt856 = { - .owner = THIS_MODULE, - .name = "bt856", + .driver = { + .owner = THIS_MODULE, + .name = "bt856", + }, .id = I2C_DRIVERID_BT856, diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c index 77619eb131f6..d6418c023d39 100644 --- a/drivers/media/video/bttv-i2c.c +++ b/drivers/media/video/bttv-i2c.c @@ -300,7 +300,7 @@ static int attach_inform(struct i2c_client *client) if (bttv_debug) printk(KERN_DEBUG "bttv%d: %s i2c attach [addr=0x%x,client=%s]\n", - btv->c.nr,client->driver->name,client->addr, + btv->c.nr, client->driver->driver.name, client->addr, client->name); if (!client->driver->command) return 0; diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index f442ce3ba74b..60484f936489 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c @@ -42,15 +42,16 @@ MODULE_PARM_DESC(debug, "Debugging messages\n\t\t\t0=Off (default), 1=On"); #define cs53l32a_dbg(fmt, arg...) \ do { \ if (debug) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); \ } while (0) #define cs53l32a_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define cs53l32a_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) static unsigned short normal_i2c[] = { 0x22 >> 1, I2C_CLIENT_END }; @@ -215,12 +216,14 @@ static int cs53l32a_detach(struct i2c_client *client) /* i2c implementation */ static struct i2c_driver i2c_driver = { - .name = "cs53l32a", + .driver = { + .owner = THIS_MODULE, + .name = "cs53l32a", + }, .id = I2C_DRIVERID_CS53L32A, .attach_adapter = cs53l32a_probe, .detach_client = cs53l32a_detach, .command = cs53l32a_command, - .owner = THIS_MODULE, }; diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 0b278abe879d..830d5195d1c0 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c @@ -843,14 +843,16 @@ static int cx25840_detach_client(struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_cx25840 = { - .name = "cx25840", + .driver = { + .owner = THIS_MODULE, + .name = "cx25840", + }, .id = I2C_DRIVERID_CX25840, .attach_adapter = cx25840_attach_adapter, .detach_client = cx25840_detach_client, .command = cx25840_command, - .owner = THIS_MODULE, }; diff --git a/drivers/media/video/cx25840/cx25840.h b/drivers/media/video/cx25840/cx25840.h index 4932ed1c9b19..40aa59f9c525 100644 --- a/drivers/media/video/cx25840/cx25840.h +++ b/drivers/media/video/cx25840/cx25840.h @@ -27,15 +27,16 @@ extern int cx25840_debug; #define cx25840_dbg(fmt, arg...) do { if (cx25840_debug) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define cx25840_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define cx25840_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0) diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index 9790d412f192..4a8fb161b16a 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c @@ -94,7 +94,7 @@ static int attach_inform(struct i2c_client *client) struct cx88_core *core = i2c_get_adapdata(client->adapter); dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n", - client->driver->name, client->addr, client->name); + client->driver->driver.name, client->addr, client->name); if (!client->driver->command) return 0; diff --git a/drivers/media/video/indycam.c b/drivers/media/video/indycam.c index 3eba514cdb29..96a808e8b2ca 100644 --- a/drivers/media/video/indycam.c +++ b/drivers/media/video/indycam.c @@ -451,8 +451,10 @@ static int indycam_command(struct i2c_client *client, unsigned int cmd, } static struct i2c_driver i2c_driver_indycam = { - .owner = THIS_MODULE, - .name = "indycam", + .driver = { + .owner = THIS_MODULE, + .name = "indycam", + }, .id = I2C_DRIVERID_INDYCAM, .attach_adapter = indycam_probe, .detach_client = indycam_detach, diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 2e2f78a4afc8..82c7f5042659 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c @@ -278,7 +278,10 @@ static int ir_detach(struct i2c_client *client); static int ir_probe(struct i2c_adapter *adap); static struct i2c_driver driver = { - .name = "ir remote kbd driver", + .driver = { + .owner = THIS_MODULE, + .name = "ir remote kbd driver", + }, .id = I2C_DRIVERID_INFRARED, .attach_adapter = ir_probe, .detach_client = ir_detach, diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index c5e8ad3aac4a..3847d890d632 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c @@ -59,7 +59,8 @@ #define msp3400_dbg(fmt, arg...) \ do { \ if (debug) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); \ } while (0) @@ -67,7 +68,8 @@ #define msp3400_dbg_mediumvol(fmt, arg...) \ do { \ if (debug >= 2) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); \ } while (0) @@ -75,18 +77,19 @@ #define msp3400_dbg_highvol(fmt, arg...) \ do { \ if (debug >= 16) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); \ } while (0) #define msp3400_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define msp3400_warn(fmt, arg...) do { \ - printk(KERN_WARNING "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_WARNING "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define msp3400_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define OPMODE_AUTO -1 @@ -1561,13 +1564,13 @@ static int msp_resume(struct device * dev); static void msp_wake_thread(struct i2c_client *client); static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "msp3400", .id = I2C_DRIVERID_MSP3400, .attach_adapter = msp_probe, .detach_client = msp_detach, .command = msp_command, .driver = { + .owner = THIS_MODULE, + .name = "i2c msp3400 driver", .suspend = msp_suspend, .resume = msp_resume, }, diff --git a/drivers/media/video/ovcamchip/ovcamchip_core.c b/drivers/media/video/ovcamchip/ovcamchip_core.c index 390d0d6c7838..9ac398b2d915 100644 --- a/drivers/media/video/ovcamchip/ovcamchip_core.c +++ b/drivers/media/video/ovcamchip/ovcamchip_core.c @@ -410,8 +410,10 @@ static int ovcamchip_command(struct i2c_client *c, unsigned int cmd, void *arg) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "ovcamchip", + .driver = { + .owner = THIS_MODULE, + .name = "ovcamchip", + }, .id = I2C_DRIVERID_OVCAMCHIP, .class = I2C_CLASS_CAM_DIGITAL, .attach_adapter = ovcamchip_attach, diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c index 9bf686989aab..8c99edbe1843 100644 --- a/drivers/media/video/saa5246a.c +++ b/drivers/media/video/saa5246a.c @@ -163,8 +163,10 @@ static int saa5246a_command(struct i2c_client *device, unsigned int cmd, static struct i2c_driver i2c_driver_videotext = { - .owner = THIS_MODULE, - .name = IF_NAME, /* name */ + .driver = { + .owner = THIS_MODULE, + .name = IF_NAME, /* name */ + }, .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ .attach_adapter = saa5246a_probe, .detach_client = saa5246a_detach, diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c index 811e86396030..5b346bdb1d59 100644 --- a/drivers/media/video/saa5249.c +++ b/drivers/media/video/saa5249.c @@ -236,8 +236,10 @@ static int saa5249_command(struct i2c_client *device, static struct i2c_driver i2c_driver_videotext = { - .owner = THIS_MODULE, - .name = IF_NAME, /* name */ + .driver = { + .owner = THIS_MODULE, + .name = IF_NAME, /* name */ + }, .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ .attach_adapter = saa5249_probe, .detach_client = saa5249_detach, diff --git a/drivers/media/video/saa6588.c b/drivers/media/video/saa6588.c index 3d4076ca67c3..5ea36ee33b98 100644 --- a/drivers/media/video/saa6588.c +++ b/drivers/media/video/saa6588.c @@ -495,8 +495,10 @@ static int saa6588_command(struct i2c_client *client, unsigned int cmd, /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "i2c saa6588 driver", + .driver = { + .owner = THIS_MODULE, + .name = "i2c saa6588 driver", + }, .id = -1, /* FIXME */ .attach_adapter = saa6588_probe, .detach_client = saa6588_detach, diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index 8affa63c8b24..58f60baa27e9 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c @@ -586,8 +586,10 @@ saa7110_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_saa7110 = { - .owner = THIS_MODULE, - .name = "saa7110", + .driver = { + .owner = THIS_MODULE, + .name = "saa7110", + }, .id = I2C_DRIVERID_SAA7110, diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c index 2b2204564514..946eb74db374 100644 --- a/drivers/media/video/saa7111.c +++ b/drivers/media/video/saa7111.c @@ -589,8 +589,10 @@ saa7111_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_saa7111 = { - .owner = THIS_MODULE, - .name = "saa7111", + .driver = { + .owner = THIS_MODULE, + .name = "saa7111", + }, .id = I2C_DRIVERID_SAA7111A, diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index 285f6c7a8f71..df53b58a9dbc 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c @@ -1203,8 +1203,10 @@ saa7114_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_saa7114 = { - .owner = THIS_MODULE, - .name = "saa7114", + .driver = { + .owner = THIS_MODULE, + .name = "saa7114", + }, .id = I2C_DRIVERID_SAA7114, diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 79aadd2d408f..6ac1ab4c9809 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -52,15 +52,16 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)"); #define saa7115_dbg(fmt,arg...) \ do { \ if (debug) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); \ } while (0) #define saa7115_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define saa7115_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) static unsigned short normal_i2c[] = { 0x42 >> 1, 0x40 >> 1, I2C_CLIENT_END }; @@ -1353,12 +1354,14 @@ static int saa7115_detach(struct i2c_client *client) /* i2c implementation */ static struct i2c_driver i2c_driver_saa7115 = { - .name = "saa7115", + .driver = { + .owner = THIS_MODULE, + .name = "saa7115", + }, .id = I2C_DRIVERID_SAA711X, .attach_adapter = saa7115_probe, .detach_client = saa7115_detach, .command = saa7115_command, - .owner = THIS_MODULE, }; diff --git a/drivers/media/video/saa711x.c b/drivers/media/video/saa711x.c index 44bfc047704c..3f7cfb7e46eb 100644 --- a/drivers/media/video/saa711x.c +++ b/drivers/media/video/saa711x.c @@ -564,8 +564,10 @@ saa711x_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_saa711x = { - .owner = THIS_MODULE, - .name = "saa711x", + .driver = { + .owner = THIS_MODULE, + .name = "saa711x", + }, .id = I2C_DRIVERID_SAA711X, diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 1f4b41599445..659cb8a0b21c 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c @@ -69,7 +69,8 @@ MODULE_PARM_DESC(test_image, "test_image (0-1)"); #define saa7127_dbg(fmt, arg...) \ do { \ if (debug >= 1) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); \ } while (0) @@ -77,15 +78,16 @@ MODULE_PARM_DESC(test_image, "test_image (0-1)"); #define saa7127_dbg_highvol(fmt, arg...) \ do { \ if (debug == 2) \ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s debug %d-%04x: " fmt, \ + client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); \ } while (0) #define saa7127_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define saa7127_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END }; @@ -818,12 +820,14 @@ static int saa7127_detach(struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_saa7127 = { - .name = "saa7127", + .driver = { + .owner = THIS_MODULE, + .name = "saa7127", + }, .id = I2C_DRIVERID_SAA7127, .attach_adapter = saa7127_probe, .detach_client = saa7127_detach, .command = saa7127_command, - .owner = THIS_MODULE, }; diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index 68206060c92d..0e8c9ed62b13 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c @@ -597,8 +597,10 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "i2c saa6752hs MPEG encoder", + .driver = { + .owner = THIS_MODULE, + .name = "i2c saa6752hs MPEG encoder", + }, .id = I2C_DRIVERID_SAA6752HS, .attach_adapter = saa6752hs_probe, .detach_client = saa6752hs_detach, diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c index df9dd36721e0..1792d03d621d 100644 --- a/drivers/media/video/saa7134/saa7134-i2c.c +++ b/drivers/media/video/saa7134/saa7134-i2c.c @@ -333,7 +333,7 @@ static int attach_inform(struct i2c_client *client) struct tuner_setup tun_setup; d1printk( "%s i2c attach [addr=0x%x,client=%s]\n", - client->driver->name, client->addr, client->name); + client->driver->driver.name, client->addr, client->name); /* Am I an i2c remote control? */ @@ -343,7 +343,7 @@ static int attach_inform(struct i2c_client *client) { struct IR_i2c *ir = i2c_get_clientdata(client); d1printk("%s i2c IR detected (%s).\n", - client->driver->name,ir->phys); + client->driver->driver.name, ir->phys); saa7134_set_i2c_ir(dev,ir); break; } diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index 9f37585d3f73..64047d77388c 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c @@ -486,8 +486,10 @@ saa7185_detach_client (struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver i2c_driver_saa7185 = { - .owner = THIS_MODULE, - .name = "saa7185", /* name */ + .driver = { + .owner = THIS_MODULE, + .name = "saa7185", /* name */ + }, .id = I2C_DRIVERID_SAA7185B, diff --git a/drivers/media/video/saa7191.c b/drivers/media/video/saa7191.c index 6be98fc0fe24..a0f8eaf251ef 100644 --- a/drivers/media/video/saa7191.c +++ b/drivers/media/video/saa7191.c @@ -788,8 +788,10 @@ static int saa7191_command(struct i2c_client *client, unsigned int cmd, } static struct i2c_driver i2c_driver_saa7191 = { - .owner = THIS_MODULE, - .name = "saa7191", + .driver = { + .owner = THIS_MODULE, + .name = "saa7191", + }, .id = I2C_DRIVERID_SAA7191, .attach_adapter = saa7191_probe, .detach_client = saa7191_detach, diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c index 239a58666a12..59674d928ff7 100644 --- a/drivers/media/video/tda7432.c +++ b/drivers/media/video/tda7432.c @@ -501,8 +501,10 @@ static int tda7432_command(struct i2c_client *client, } static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "i2c tda7432 driver", + .driver = { + .owner = THIS_MODULE, + .name = "i2c tda7432 driver", + }, .id = I2C_DRIVERID_TDA7432, .attach_adapter = tda7432_probe, .detach_client = tda7432_detach, diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index f29fb507075d..8efc726874fc 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c @@ -221,8 +221,10 @@ static int detach(struct i2c_client *client) } static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "tda9840", + .driver = { + .owner = THIS_MODULE, + .name = "tda9840", + }, .id = I2C_DRIVERID_TDA9840, .attach_adapter = attach, .detach_client = detach, diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c index d053b6445502..de896167029e 100644 --- a/drivers/media/video/tda9875.c +++ b/drivers/media/video/tda9875.c @@ -372,8 +372,10 @@ static int tda9875_command(struct i2c_client *client, static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "i2c tda9875 driver", + .driver = { + .owner = THIS_MODULE, + .name = "i2c tda9875 driver", + }, .id = I2C_DRIVERID_TDA9875, .attach_adapter = tda9875_probe, .detach_client = tda9875_detach, diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 324f61bf714e..081f47805158 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -819,13 +819,13 @@ static int tda9887_resume(struct device * dev) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "i2c tda9887 driver", .id = -1, /* FIXME */ .attach_adapter = tda9887_probe, .detach_client = tda9887_detach, .command = tda9887_command, .driver = { + .owner = THIS_MODULE, + .name = "i2c tda9887 driver", .suspend = tda9887_suspend, .resume = tda9887_resume, }, diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index 96d88ce60c98..e7e2213c39e1 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c @@ -190,8 +190,10 @@ static int command(struct i2c_client *client, unsigned int cmd, void *arg) } static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "tea6415c", + .driver = { + .owner = THIS_MODULE, + .name = "tea6415c", + }, .id = I2C_DRIVERID_TEA6415C, .attach_adapter = attach, .detach_client = detach, diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index fd417de95847..74cc25f04056 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c @@ -167,8 +167,10 @@ static int command(struct i2c_client *client, unsigned int cmd, void *arg) } static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "tea6420", + .driver = { + .owner = THIS_MODULE, + .name = "tea6420", + }, .id = I2C_DRIVERID_TEA6420, .attach_adapter = attach, .detach_client = detach, diff --git a/drivers/media/video/tuner-3036.c b/drivers/media/video/tuner-3036.c index 3505cec2e65a..83257af8db41 100644 --- a/drivers/media/video/tuner-3036.c +++ b/drivers/media/video/tuner-3036.c @@ -175,8 +175,10 @@ tuner_probe(struct i2c_adapter *adap) static struct i2c_driver i2c_driver_tuner = { - .owner = THIS_MODULE, - .name = "sab3036", + .driver = { + .owner = THIS_MODULE, + .name = "sab3036", + }, .id = I2C_DRIVERID_SAB3036, .attach_adapter = tuner_probe, .detach_client = tuner_detach, diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 6328f0954e70..e8c854948de9 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -206,7 +206,7 @@ static void set_type(struct i2c_client *c, unsigned int type, set_freq(c, t->freq); tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n", - c->adapter->name, c->driver->name, c->addr << 1, type, + c->adapter->name, c->driver->driver.name, c->addr << 1, type, t->mode_mask); } @@ -742,13 +742,13 @@ static int tuner_resume(struct device *dev) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "tuner", .id = I2C_DRIVERID_TUNER, .attach_adapter = tuner_probe, .detach_client = tuner_detach, .command = tuner_command, .driver = { + .owner = THIS_MODULE, + .name = "tuner", .suspend = tuner_suspend, .resume = tuner_resume, }, diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 4f1f339283e0..30bb2a3615e9 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c @@ -1702,8 +1702,10 @@ static int chip_command(struct i2c_client *client, static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "generic i2c audio driver", + .driver = { + .owner = THIS_MODULE, + .name = "generic i2c audio driver", + }, .id = I2C_DRIVERID_TVAUDIO, .attach_adapter = chip_probe, .detach_client = chip_detach, diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index d833b651073a..d8b5a1781809 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c @@ -778,8 +778,10 @@ tveeprom_detach_client (struct i2c_client *client) } static struct i2c_driver i2c_driver_tveeprom = { - .owner = THIS_MODULE, - .name = "tveeprom", + .driver = { + .owner = THIS_MODULE, + .name = "tveeprom", + }, .id = I2C_DRIVERID_TVEEPROM, .attach_adapter = tveeprom_attach_adapter, .detach_client = tveeprom_detach_client, diff --git a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c index 936e01d2c785..5f4d01854767 100644 --- a/drivers/media/video/tvmixer.c +++ b/drivers/media/video/tvmixer.c @@ -228,9 +228,13 @@ static int tvmixer_release(struct inode *inode, struct file *file) static struct i2c_driver driver = { #ifdef I2C_PEC - .owner = THIS_MODULE, -#endif + .driver = { + .owner = THIS_MODULE, + .name = "tv card mixer driver", + }, +#else .name = "tv card mixer driver", +#endif .id = I2C_DRIVERID_TVMIXER, .detach_adapter = tvmixer_adapters, .attach_adapter = tvmixer_adapters, diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 3734554fc73b..5eca71fa8cbd 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -800,8 +800,10 @@ static int tvp5150_detach_client(struct i2c_client *client) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "tvp5150", + .driver = { + .owner = THIS_MODULE, + .name = "tvp5150", + }, /* FIXME */ .id = I2C_DRIVERID_SAA7110, diff --git a/drivers/media/video/vpx3220.c b/drivers/media/video/vpx3220.c index 54bc888c3891..b85b5981fb8d 100644 --- a/drivers/media/video/vpx3220.c +++ b/drivers/media/video/vpx3220.c @@ -721,8 +721,10 @@ vpx3220_attach_adapter (struct i2c_adapter *adapter) */ static struct i2c_driver vpx3220_i2c_driver = { - .owner = THIS_MODULE, - .name = "vpx3220", + .driver = { + .owner = THIS_MODULE, + .name = "vpx3220", + }, .id = I2C_DRIVERID_VPX3220, diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index 527c2591749a..22875f1fa1ab 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c @@ -40,10 +40,10 @@ MODULE_AUTHOR("Ulf Eklund, Hans Verkuil"); MODULE_LICENSE("GPL"); #define wm8775_err(fmt, arg...) do { \ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) #define wm8775_info(fmt, arg...) do { \ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \ i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0) @@ -232,14 +232,16 @@ static int wm8775_detach(struct i2c_client *client) /* i2c implementation */ static struct i2c_driver i2c_driver = { - .name = "wm8775", + .driver = { + .owner = THIS_MODULE, + .name = "wm8775", + }, .id = I2C_DRIVERID_WM8775, .attach_adapter = wm8775_probe, .detach_client = wm8775_detach, .command = wm8775_command, - .owner = THIS_MODULE, }; diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index 07bde9acd672..4034f1b45366 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c @@ -1311,7 +1311,7 @@ zoran_open (struct inode *inode, res = -ENODEV; goto open_unlock_and_return; } - if (!try_module_get(zr->decoder->driver->owner)) { + if (!try_module_get(zr->decoder->driver->driver.owner)) { dprintk(1, KERN_ERR "%s: failed to grab ownership of i2c decoder\n", @@ -1321,13 +1321,13 @@ zoran_open (struct inode *inode, goto open_unlock_and_return; } if (zr->encoder && - !try_module_get(zr->encoder->driver->owner)) { + !try_module_get(zr->encoder->driver->driver.owner)) { dprintk(1, KERN_ERR "%s: failed to grab ownership of i2c encoder\n", ZR_DEVNAME(zr)); res = -EIO; - module_put(zr->decoder->driver->owner); + module_put(zr->decoder->driver->driver.owner); module_put(THIS_MODULE); goto open_unlock_and_return; } @@ -1393,9 +1393,9 @@ zoran_open (struct inode *inode, open_unlock_and_return: /* if we grabbed locks, release them accordingly */ if (have_module_locks) { - module_put(zr->decoder->driver->owner); + module_put(zr->decoder->driver->driver.owner); if (zr->encoder) { - module_put(zr->encoder->driver->owner); + module_put(zr->encoder->driver->driver.owner); } module_put(THIS_MODULE); } @@ -1461,9 +1461,9 @@ zoran_close (struct inode *inode, kfree(fh); /* release locks on the i2c modules */ - module_put(zr->decoder->driver->owner); + module_put(zr->decoder->driver->driver.owner); if (zr->encoder) { - module_put(zr->encoder->driver->owner); + module_put(zr->encoder->driver->driver.owner); } module_put(THIS_MODULE); diff --git a/drivers/usb/media/w9968cf.c b/drivers/usb/media/w9968cf.c index 04d69339c054..3605a6f3067b 100644 --- a/drivers/usb/media/w9968cf.c +++ b/drivers/usb/media/w9968cf.c @@ -1533,12 +1533,12 @@ static int w9968cf_i2c_attach_inform(struct i2c_client* client) } } else { DBG(4, "Rejected client [%s] with driver [%s]", - client->name, client->driver->name) + client->name, client->driver->driver.name) return -EINVAL; } DBG(5, "I2C attach client [%s] with driver [%s]", - client->name, client->driver->name) + client->name, client->driver->driver.name) return 0; } diff --git a/include/media/tuner.h b/include/media/tuner.h index faa0f8e3091b..b37cde606692 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -218,14 +218,15 @@ extern int default_tuner_init(struct i2c_client *c); extern int tea5767_autodetection(struct i2c_client *c); #define tuner_warn(fmt, arg...) do {\ - printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->name, \ + printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #define tuner_info(fmt, arg...) do {\ - printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #define tuner_dbg(fmt, arg...) do {\ if (tuner_debug) \ - printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \ + printk(KERN_DEBUG "%s %d-%04x: " fmt, \ + t->i2c.driver->driver.name, \ t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #endif /* __KERNEL__ */ -- cgit v1.2.3 From de59cf9ed44f64991e52a9de6094729537f0420c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 6 Dec 2005 15:33:15 -0800 Subject: [PATCH] I2C: Make i2c_add_driver automatically set the proper module owner This prevents i2c drivers from messing up and forgetting to set the module owner of their driver. It also reduces the size of their drivers by one line :) Signed-off-by: Greg Kroah-Hartman Cc: Jean Delvare --- drivers/i2c/i2c-core.c | 5 +++-- include/linux/i2c.h | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 4ce5f0f32fba..c23443ee1b33 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -287,7 +287,7 @@ int i2c_del_adapter(struct i2c_adapter *adap) * chips. */ -int i2c_add_driver(struct i2c_driver *driver) +int i2c_register_driver(struct module *owner, struct i2c_driver *driver) { struct list_head *item; struct i2c_adapter *adapter; @@ -296,6 +296,7 @@ int i2c_add_driver(struct i2c_driver *driver) down(&core_lists); /* add the driver to the list of i2c drivers in the driver core */ + driver->driver.owner = owner; driver->driver.bus = &i2c_bus_type; driver->driver.probe = i2c_device_probe; driver->driver.remove = i2c_device_remove; @@ -319,6 +320,7 @@ int i2c_add_driver(struct i2c_driver *driver) up(&core_lists); return res; } +EXPORT_SYMBOL(i2c_register_driver); int i2c_del_driver(struct i2c_driver *driver) { @@ -1132,7 +1134,6 @@ EXPORT_SYMBOL_GPL(i2c_bus_type); EXPORT_SYMBOL(i2c_add_adapter); EXPORT_SYMBOL(i2c_del_adapter); -EXPORT_SYMBOL(i2c_add_driver); EXPORT_SYMBOL(i2c_del_driver); EXPORT_SYMBOL(i2c_attach_client); EXPORT_SYMBOL(i2c_detach_client); diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 75aa18e865da..7863a59bd598 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -291,9 +291,14 @@ struct i2c_client_address_data { extern int i2c_add_adapter(struct i2c_adapter *); extern int i2c_del_adapter(struct i2c_adapter *); -extern int i2c_add_driver(struct i2c_driver *); +extern int i2c_register_driver(struct module *, struct i2c_driver *); extern int i2c_del_driver(struct i2c_driver *); +static inline int i2c_add_driver(struct i2c_driver *driver) +{ + return i2c_register_driver(THIS_MODULE, driver); +} + extern int i2c_attach_client(struct i2c_client *); extern int i2c_detach_client(struct i2c_client *); -- cgit v1.2.3 From 734a12a36676ad3b9418fa5a829c518afec02b8a Mon Sep 17 00:00:00 2001 From: Rudolf Marek Date: Sun, 18 Dec 2005 16:36:52 +0100 Subject: [PATCH] hwmon: add VRM/VID support for some VIA CPUs This patch adds the VIA CENTAUR CPUs to detection table. Table was updated to treat future Intel x86 CPUs as VRD10. Stepping field was added, because some VIA CPUs have different VRM specs across stepping. I changed the vrm type to u8 because all drivers use u8 anyway. Signed-off-by: Rudolf Marek Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/hwmon-vid.c | 69 ++++++++++++++++++++++++++++------------------- include/linux/hwmon-vid.h | 6 ++--- 2 files changed, 45 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/drivers/hwmon/hwmon-vid.c b/drivers/hwmon/hwmon-vid.c index 312769ad4dab..e497274916ce 100644 --- a/drivers/hwmon/hwmon-vid.c +++ b/drivers/hwmon/hwmon-vid.c @@ -49,20 +49,22 @@ . . . . 11110 = 0.800 V 11111 = 0.000 V (off) + + The 17 specification is in fact Intel Mobile Voltage Positioning - + (IMVP-II). You can find more information in the datasheet of Max1718 + http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2452 + */ /* vrm is the VRM/VRD document version multiplied by 10. val is the 4-, 5- or 6-bit VID code. Returned value is in mV to avoid floating point in the kernel. */ -int vid_from_reg(int val, int vrm) +int vid_from_reg(int val, u8 vrm) { int vid; switch(vrm) { - case 0: - return 0; - case 100: /* VRD 10.0 */ if((val & 0x1f) == 0x1f) return 0; @@ -91,10 +93,16 @@ int vid_from_reg(int val, int vrm) case 84: /* VRM 8.4 */ val &= 0x0f; /* fall through */ - default: /* VRM 8.2 */ + case 82: /* VRM 8.2 */ return(val == 0x1f ? 0 : val & 0x10 ? 5100 - (val) * 100 : 2050 - (val) * 50); + case 17: /* Intel IMVP-II */ + return(val & 0x10 ? 975 - (val & 0xF) * 25 : + 1750 - val * 50); + default: /* report 0 for unknown */ + printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n"); + return 0; } } @@ -108,30 +116,36 @@ struct vrm_model { u8 vendor; u8 eff_family; u8 eff_model; - int vrm_type; + u8 eff_stepping; + u8 vrm_type; }; #define ANY 0xFF #ifdef CONFIG_X86 +/* the stepping parameter is highest acceptable stepping for current line */ + static struct vrm_model vrm_models[] = { - {X86_VENDOR_AMD, 0x6, ANY, 90}, /* Athlon Duron etc */ - {X86_VENDOR_AMD, 0xF, ANY, 24}, /* Athlon 64, Opteron */ - {X86_VENDOR_INTEL, 0x6, 0x9, 85}, /* 0.13um too */ - {X86_VENDOR_INTEL, 0x6, 0xB, 85}, /* Tualatin */ - {X86_VENDOR_INTEL, 0x6, ANY, 82}, /* any P6 */ - {X86_VENDOR_INTEL, 0x7, ANY, 0}, /* Itanium */ - {X86_VENDOR_INTEL, 0xF, 0x0, 90}, /* P4 */ - {X86_VENDOR_INTEL, 0xF, 0x1, 90}, /* P4 Willamette */ - {X86_VENDOR_INTEL, 0xF, 0x2, 90}, /* P4 Northwood */ - {X86_VENDOR_INTEL, 0xF, 0x3, 100}, /* P4 Prescott */ - {X86_VENDOR_INTEL, 0xF, 0x4, 100}, /* P4 Prescott */ - {X86_VENDOR_INTEL, 0x10,ANY, 0}, /* Itanium 2 */ - {X86_VENDOR_UNKNOWN, ANY, ANY, 0} /* stop here */ + {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */ + {X86_VENDOR_AMD, 0xF, ANY, ANY, 24}, /* Athlon 64, Opteron and above VRM 24 */ + {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 85}, /* 0.13um too */ + {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */ + {X86_VENDOR_INTEL, 0x6, ANY, ANY, 82}, /* any P6 */ + {X86_VENDOR_INTEL, 0x7, ANY, ANY, 0}, /* Itanium */ + {X86_VENDOR_INTEL, 0xF, 0x0, ANY, 90}, /* P4 */ + {X86_VENDOR_INTEL, 0xF, 0x1, ANY, 90}, /* P4 Willamette */ + {X86_VENDOR_INTEL, 0xF, 0x2, ANY, 90}, /* P4 Northwood */ + {X86_VENDOR_INTEL, 0xF, ANY, ANY, 100}, /* Prescott and above assume VRD 10 */ + {X86_VENDOR_INTEL, 0x10, ANY, ANY, 0}, /* Itanium 2 */ + {X86_VENDOR_CENTAUR, 0x6, 0x7, ANY, 85}, /* Eden ESP/Ezra */ + {X86_VENDOR_CENTAUR, 0x6, 0x8, 0x7, 85}, /* Ezra T */ + {X86_VENDOR_CENTAUR, 0x6, 0x9, 0x7, 85}, /* Nemiah */ + {X86_VENDOR_CENTAUR, 0x6, 0x9, ANY, 17}, /* C3-M */ + {X86_VENDOR_UNKNOWN, ANY, ANY, ANY, 0} /* stop here */ }; -static int find_vrm(u8 eff_family, u8 eff_model, u8 vendor) +static u8 find_vrm(u8 eff_family, u8 eff_model, u8 eff_stepping, u8 vendor) { int i = 0; @@ -139,7 +153,8 @@ static int find_vrm(u8 eff_family, u8 eff_model, u8 vendor) if (vrm_models[i].vendor==vendor) if ((vrm_models[i].eff_family==eff_family) && ((vrm_models[i].eff_model==eff_model) || - (vrm_models[i].eff_model==ANY))) + (vrm_models[i].eff_model==ANY)) && + (eff_stepping <= vrm_models[i].eff_stepping)) return vrm_models[i].vrm_type; i++; } @@ -147,12 +162,11 @@ static int find_vrm(u8 eff_family, u8 eff_model, u8 vendor) return 0; } -int vid_which_vrm(void) +u8 vid_which_vrm(void) { struct cpuinfo_x86 *c = cpu_data; u32 eax; - u8 eff_family, eff_model; - int vrm_ret; + u8 eff_family, eff_model, eff_stepping, vrm_ret; if (c->x86 < 6) /* Any CPU with family lower than 6 */ return 0; /* doesn't have VID and/or CPUID */ @@ -160,20 +174,21 @@ int vid_which_vrm(void) eax = cpuid_eax(1); eff_family = ((eax & 0x00000F00)>>8); eff_model = ((eax & 0x000000F0)>>4); + eff_stepping = eax & 0xF; if (eff_family == 0xF) { /* use extended model & family */ eff_family += ((eax & 0x00F00000)>>20); eff_model += ((eax & 0x000F0000)>>16)<<4; } - vrm_ret = find_vrm(eff_family,eff_model,c->x86_vendor); + vrm_ret = find_vrm(eff_family, eff_model, eff_stepping, c->x86_vendor); if (vrm_ret == 0) printk(KERN_INFO "hwmon-vid: Unknown VRM version of your " "x86 CPU\n"); return vrm_ret; } -/* and now something completely different for the non-x86 world */ +/* and now for something completely different for the non-x86 world */ #else -int vid_which_vrm(void) +u8 vid_which_vrm(void) { printk(KERN_INFO "hwmon-vid: Unknown VRM version of your CPU\n"); return 0; diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h index cd4b7a042b86..f346e4d5381c 100644 --- a/include/linux/hwmon-vid.h +++ b/include/linux/hwmon-vid.h @@ -23,14 +23,14 @@ #ifndef _LINUX_HWMON_VID_H #define _LINUX_HWMON_VID_H -int vid_from_reg(int val, int vrm); -int vid_which_vrm(void); +int vid_from_reg(int val, u8 vrm); +u8 vid_which_vrm(void); /* vrm is the VRM/VRD document version multiplied by 10. val is in mV to avoid floating point in the kernel. Returned value is the 4-, 5- or 6-bit VID code. Note that only VRM 9.x is supported for now. */ -static inline int vid_to_reg(int val, int vrm) +static inline int vid_to_reg(int val, u8 vrm) { switch (vrm) { case 91: /* VRM 9.1 */ -- cgit v1.2.3 From 04b4b8434a92b9ef127985113c0bd961957778b7 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 18 Dec 2005 16:42:35 +0100 Subject: [PATCH] i2c: driver ID list cleanups Cleanups to i2c driver ID list: * Remove mostly bogus comments about driver ID ranges. * Drop experimental driver IDs, as the concept is pretty broken. * Drop now unused IDs of non-I2C (ISA) drivers. * Drop a few more IDs which are no more used. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-id.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 006c81ef4d50..fb46f8d56999 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -25,12 +25,6 @@ /* * ---- Driver types ----------------------------------------------------- - * device id name + number function description, i2c address(es) - * - * Range 1000-1999 range is defined in sensors/sensors.h - * Range 0x100 - 0x1ff is for V4L2 Common Components - * Range 0xf000 - 0xffff is reserved for local experimentation, and should - * never be used in official drivers */ #define I2C_DRIVERID_MSP3400 1 @@ -110,13 +104,7 @@ #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ -#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ -#define I2C_DRIVERID_EXP1 0xF1 -#define I2C_DRIVERID_EXP2 0xF2 -#define I2C_DRIVERID_EXP3 0xF3 - #define I2C_DRIVERID_I2CDEV 900 -#define I2C_DRIVERID_I2CPROC 901 #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ #define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ @@ -131,15 +119,12 @@ #define I2C_DRIVERID_ADM1021 1008 #define I2C_DRIVERID_ADM9240 1009 #define I2C_DRIVERID_LTC1710 1010 -#define I2C_DRIVERID_SIS5595 1011 #define I2C_DRIVERID_ICSPLL 1012 #define I2C_DRIVERID_BT869 1013 #define I2C_DRIVERID_MAXILIFE 1014 #define I2C_DRIVERID_MATORB 1015 #define I2C_DRIVERID_GL520 1016 #define I2C_DRIVERID_THMC50 1017 -#define I2C_DRIVERID_DDCMON 1018 -#define I2C_DRIVERID_VIA686A 1019 #define I2C_DRIVERID_ADM1025 1020 #define I2C_DRIVERID_LM87 1021 #define I2C_DRIVERID_PCF8574 1022 @@ -151,21 +136,16 @@ #define I2C_DRIVERID_FSCPOS 1028 #define I2C_DRIVERID_FSCSCY 1029 #define I2C_DRIVERID_PCF8591 1030 -#define I2C_DRIVERID_SMSC47M1 1031 -#define I2C_DRIVERID_VT1211 1032 #define I2C_DRIVERID_LM92 1033 -#define I2C_DRIVERID_VT8231 1034 #define I2C_DRIVERID_SMARTBATT 1035 #define I2C_DRIVERID_BMCSENSORS 1036 #define I2C_DRIVERID_FS451 1037 -#define I2C_DRIVERID_W83627HF 1038 #define I2C_DRIVERID_LM85 1039 #define I2C_DRIVERID_LM83 1040 #define I2C_DRIVERID_LM90 1042 #define I2C_DRIVERID_ASB100 1043 #define I2C_DRIVERID_FSCHER 1046 #define I2C_DRIVERID_W83L785TS 1047 -#define I2C_DRIVERID_SMSC47B397 1050 /* * ---- Adapter types ---------------------------------------------------- -- cgit v1.2.3 From 7c72ccf09b6debe55b8e049377ad3183ed4f4cb3 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 18 Dec 2005 17:25:18 +0100 Subject: [PATCH] i2c: i2c-nforce2 add nforce4 MCP-04 device ID One more supported PCI ID for the i2c-nforce2 driver. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- Documentation/i2c/busses/i2c-nforce2 | 3 ++- drivers/i2c/busses/i2c-nforce2.c | 2 ++ include/linux/pci_ids.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/Documentation/i2c/busses/i2c-nforce2 b/Documentation/i2c/busses/i2c-nforce2 index e379e182e64f..d751282d9b2a 100644 --- a/Documentation/i2c/busses/i2c-nforce2 +++ b/Documentation/i2c/busses/i2c-nforce2 @@ -5,7 +5,8 @@ Supported adapters: * nForce2 Ultra 400 MCP 10de:0084 * nForce3 Pro150 MCP 10de:00D4 * nForce3 250Gb MCP 10de:00E4 - * nForce4 MCP 10de:0052 + * nForce4 MCP 10de:0052 + * nForce4 MCP-04 10de:0034 Datasheet: not publically available, but seems to be similar to the AMD-8111 SMBus 2.0 adapter. diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c index 4d18e6e5f159..2d80eb26f688 100644 --- a/drivers/i2c/busses/i2c-nforce2.c +++ b/drivers/i2c/busses/i2c-nforce2.c @@ -30,6 +30,7 @@ nForce3 Pro150 MCP 00D4 nForce3 250Gb MCP 00E4 nForce4 MCP 0052 + nForce4 MCP-04 0034 This driver supports the 2 SMBuses that are included in the MCP of the nForce2/3/4 chipsets. @@ -257,6 +258,7 @@ static struct pci_device_id nforce2_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS) }, { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE4_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS) }, { 0 } }; diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4f01710485cd..96a0403f61f6 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -976,6 +976,7 @@ #define PCI_DEVICE_ID_NVIDIA_TNT_UNKNOWN 0x002a #define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C #define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS 0x0034 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036 #define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037 -- cgit v1.2.3