aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-12-14 15:17:25 -0500
committerJean Delvare <khali@linux-fr.org>2009-12-14 15:17:25 -0500
commitc3813d6af177fab19e322f3114b1f64fbcf08d71 (patch)
tree5189e18f95c954461040bc4becbca6acf739c13b
parent310ec79210d754afe51e2e4a983e846b60179abd (diff)
i2c: Get rid of struct i2c_client_address_data
Struct i2c_client_address_data only contains one field at this point, which makes its usefulness questionable. Get rid of it and pass simple address lists around instead. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de>
-rw-r--r--Documentation/i2c/writing-clients2
-rw-r--r--drivers/hwmon/adm1021.c2
-rw-r--r--drivers/hwmon/adm1025.c2
-rw-r--r--drivers/hwmon/adm1026.c2
-rw-r--r--drivers/hwmon/adm1029.c2
-rw-r--r--drivers/hwmon/adm1031.c2
-rw-r--r--drivers/hwmon/adm9240.c2
-rw-r--r--drivers/hwmon/ads7828.c2
-rw-r--r--drivers/hwmon/adt7462.c2
-rw-r--r--drivers/hwmon/adt7470.c2
-rw-r--r--drivers/hwmon/adt7473.c2
-rw-r--r--drivers/hwmon/adt7475.c2
-rw-r--r--drivers/hwmon/asb100.c2
-rw-r--r--drivers/hwmon/atxp1.c2
-rw-r--r--drivers/hwmon/dme1737.c2
-rw-r--r--drivers/hwmon/ds1621.c2
-rw-r--r--drivers/hwmon/f75375s.c2
-rw-r--r--drivers/hwmon/fschmd.c2
-rw-r--r--drivers/hwmon/gl518sm.c2
-rw-r--r--drivers/hwmon/gl520sm.c2
-rw-r--r--drivers/hwmon/lm63.c2
-rw-r--r--drivers/hwmon/lm73.c2
-rw-r--r--drivers/hwmon/lm75.c2
-rw-r--r--drivers/hwmon/lm77.c2
-rw-r--r--drivers/hwmon/lm78.c2
-rw-r--r--drivers/hwmon/lm80.c2
-rw-r--r--drivers/hwmon/lm83.c2
-rw-r--r--drivers/hwmon/lm85.c2
-rw-r--r--drivers/hwmon/lm87.c2
-rw-r--r--drivers/hwmon/lm90.c2
-rw-r--r--drivers/hwmon/lm92.c2
-rw-r--r--drivers/hwmon/lm93.c2
-rw-r--r--drivers/hwmon/lm95241.c2
-rw-r--r--drivers/hwmon/max1619.c2
-rw-r--r--drivers/hwmon/max6650.c2
-rw-r--r--drivers/hwmon/pcf8591.c2
-rw-r--r--drivers/hwmon/smsc47m192.c2
-rw-r--r--drivers/hwmon/thmc50.c2
-rw-r--r--drivers/hwmon/tmp401.c2
-rw-r--r--drivers/hwmon/tmp421.c2
-rw-r--r--drivers/hwmon/w83781d.c2
-rw-r--r--drivers/hwmon/w83791d.c2
-rw-r--r--drivers/hwmon/w83792d.c2
-rw-r--r--drivers/hwmon/w83793.c2
-rw-r--r--drivers/hwmon/w83l785ts.c2
-rw-r--r--drivers/hwmon/w83l786ng.c2
-rw-r--r--drivers/i2c/i2c-core.c15
-rw-r--r--drivers/misc/eeprom/eeprom.c2
-rw-r--r--drivers/misc/ics932s401.c2
-rw-r--r--include/linux/i2c.h44
50 files changed, 66 insertions, 89 deletions
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index 7860aafb483d..0a74603eb671 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -44,7 +44,7 @@ static struct i2c_driver foo_driver = {
44 /* if device autodetection is needed: */ 44 /* if device autodetection is needed: */
45 .class = I2C_CLASS_SOMETHING, 45 .class = I2C_CLASS_SOMETHING,
46 .detect = foo_detect, 46 .detect = foo_detect,
47 .address_data = &addr_data, 47 .address_list = normal_i2c,
48 48
49 .shutdown = foo_shutdown, /* optional */ 49 .shutdown = foo_shutdown, /* optional */
50 .suspend = foo_suspend, /* optional */ 50 .suspend = foo_suspend, /* optional */
diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
index 3ebcdd9c25a5..d7af039a4d43 100644
--- a/drivers/hwmon/adm1021.c
+++ b/drivers/hwmon/adm1021.c
@@ -130,7 +130,7 @@ static struct i2c_driver adm1021_driver = {
130 .remove = adm1021_remove, 130 .remove = adm1021_remove,
131 .id_table = adm1021_id, 131 .id_table = adm1021_id,
132 .detect = adm1021_detect, 132 .detect = adm1021_detect,
133 .address_data = &addr_data, 133 .address_list = normal_i2c,
134}; 134};
135 135
136static ssize_t show_temp(struct device *dev, 136static ssize_t show_temp(struct device *dev,
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
index 357c9ffa147e..e17651083b09 100644
--- a/drivers/hwmon/adm1025.c
+++ b/drivers/hwmon/adm1025.c
@@ -137,7 +137,7 @@ static struct i2c_driver adm1025_driver = {
137 .remove = adm1025_remove, 137 .remove = adm1025_remove,
138 .id_table = adm1025_id, 138 .id_table = adm1025_id,
139 .detect = adm1025_detect, 139 .detect = adm1025_detect,
140 .address_data = &addr_data, 140 .address_list = normal_i2c,
141}; 141};
142 142
143/* 143/*
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index 8deb17a402da..85bf23aea7db 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -319,7 +319,7 @@ static struct i2c_driver adm1026_driver = {
319 .remove = adm1026_remove, 319 .remove = adm1026_remove,
320 .id_table = adm1026_id, 320 .id_table = adm1026_id,
321 .detect = adm1026_detect, 321 .detect = adm1026_detect,
322 .address_data = &addr_data, 322 .address_list = normal_i2c,
323}; 323};
324 324
325static int adm1026_read_value(struct i2c_client *client, u8 reg) 325static int adm1026_read_value(struct i2c_client *client, u8 reg)
diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c
index 9bc9dbcacdbd..a006ae5fbd2b 100644
--- a/drivers/hwmon/adm1029.c
+++ b/drivers/hwmon/adm1029.c
@@ -142,7 +142,7 @@ static struct i2c_driver adm1029_driver = {
142 .remove = adm1029_remove, 142 .remove = adm1029_remove,
143 .id_table = adm1029_id, 143 .id_table = adm1029_id,
144 .detect = adm1029_detect, 144 .detect = adm1029_detect,
145 .address_data = &addr_data, 145 .address_list = normal_i2c,
146}; 146};
147 147
148/* 148/*
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
index cebfbf6926da..1e02799b870e 100644
--- a/drivers/hwmon/adm1031.c
+++ b/drivers/hwmon/adm1031.c
@@ -125,7 +125,7 @@ static struct i2c_driver adm1031_driver = {
125 .remove = adm1031_remove, 125 .remove = adm1031_remove,
126 .id_table = adm1031_id, 126 .id_table = adm1031_id,
127 .detect = adm1031_detect, 127 .detect = adm1031_detect,
128 .address_data = &addr_data, 128 .address_list = normal_i2c,
129}; 129};
130 130
131static inline u8 adm1031_read_value(struct i2c_client *client, u8 reg) 131static inline u8 adm1031_read_value(struct i2c_client *client, u8 reg)
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 9316e074d690..d9942e74ed4a 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -156,7 +156,7 @@ static struct i2c_driver adm9240_driver = {
156 .remove = adm9240_remove, 156 .remove = adm9240_remove,
157 .id_table = adm9240_id, 157 .id_table = adm9240_id,
158 .detect = adm9240_detect, 158 .detect = adm9240_detect,
159 .address_data = &addr_data, 159 .address_list = normal_i2c,
160}; 160};
161 161
162/* per client data */ 162/* per client data */
diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index b50893111532..3827ce4be071 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -183,7 +183,7 @@ static struct i2c_driver ads7828_driver = {
183 .remove = ads7828_remove, 183 .remove = ads7828_remove,
184 .id_table = ads7828_id, 184 .id_table = ads7828_id,
185 .detect = ads7828_detect, 185 .detect = ads7828_detect,
186 .address_data = &addr_data, 186 .address_list = normal_i2c,
187}; 187};
188 188
189/* Return 0 if detection is successful, -ENODEV otherwise */ 189/* Return 0 if detection is successful, -ENODEV otherwise */
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c
index 30cf002c677f..325700428ef0 100644
--- a/drivers/hwmon/adt7462.c
+++ b/drivers/hwmon/adt7462.c
@@ -256,7 +256,7 @@ static struct i2c_driver adt7462_driver = {
256 .remove = adt7462_remove, 256 .remove = adt7462_remove,
257 .id_table = adt7462_id, 257 .id_table = adt7462_id,
258 .detect = adt7462_detect, 258 .detect = adt7462_detect,
259 .address_data = &addr_data, 259 .address_list = normal_i2c,
260}; 260};
261 261
262/* 262/*
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
index 9ffe5c6e495d..33aa0fa3e990 100644
--- a/drivers/hwmon/adt7470.c
+++ b/drivers/hwmon/adt7470.c
@@ -196,7 +196,7 @@ static struct i2c_driver adt7470_driver = {
196 .remove = adt7470_remove, 196 .remove = adt7470_remove,
197 .id_table = adt7470_id, 197 .id_table = adt7470_id,
198 .detect = adt7470_detect, 198 .detect = adt7470_detect,
199 .address_data = &addr_data, 199 .address_list = normal_i2c,
200}; 200};
201 201
202/* 202/*
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c
index 78fadaa431e2..1535733ddf19 100644
--- a/drivers/hwmon/adt7473.c
+++ b/drivers/hwmon/adt7473.c
@@ -184,7 +184,7 @@ static struct i2c_driver adt7473_driver = {
184 .remove = adt7473_remove, 184 .remove = adt7473_remove,
185 .id_table = adt7473_id, 185 .id_table = adt7473_id,
186 .detect = adt7473_detect, 186 .detect = adt7473_detect,
187 .address_data = &addr_data, 187 .address_list = normal_i2c,
188}; 188};
189 189
190/* 190/*
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 3c0571551a9f..1fb8940428c6 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -1412,7 +1412,7 @@ static struct i2c_driver adt7475_driver = {
1412 .remove = adt7475_remove, 1412 .remove = adt7475_remove,
1413 .id_table = adt7475_id, 1413 .id_table = adt7475_id,
1414 .detect = adt7475_detect, 1414 .detect = adt7475_detect,
1415 .address_data = &addr_data, 1415 .address_list = normal_i2c,
1416}; 1416};
1417 1417
1418static void adt7475_read_hystersis(struct i2c_client *client) 1418static void adt7475_read_hystersis(struct i2c_client *client)
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 507e116d5456..a92512a4a366 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -230,7 +230,7 @@ static struct i2c_driver asb100_driver = {
230 .remove = asb100_remove, 230 .remove = asb100_remove,
231 .id_table = asb100_id, 231 .id_table = asb100_id,
232 .detect = asb100_detect, 232 .detect = asb100_detect,
233 .address_data = &addr_data, 233 .address_list = normal_i2c,
234}; 234};
235 235
236/* 7 Voltages */ 236/* 7 Voltages */
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c
index 6b7459745b66..b0c3051d8a4f 100644
--- a/drivers/hwmon/atxp1.c
+++ b/drivers/hwmon/atxp1.c
@@ -67,7 +67,7 @@ static struct i2c_driver atxp1_driver = {
67 .remove = atxp1_remove, 67 .remove = atxp1_remove,
68 .id_table = atxp1_id, 68 .id_table = atxp1_id,
69 .detect = atxp1_detect, 69 .detect = atxp1_detect,
70 .address_data = &addr_data, 70 .address_list = normal_i2c,
71}; 71};
72 72
73struct atxp1_data { 73struct atxp1_data {
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index 7024617c1194..a3af09f9dbad 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -2318,7 +2318,7 @@ static struct i2c_driver dme1737_i2c_driver = {
2318 .remove = dme1737_i2c_remove, 2318 .remove = dme1737_i2c_remove,
2319 .id_table = dme1737_id, 2319 .id_table = dme1737_id,
2320 .detect = dme1737_i2c_detect, 2320 .detect = dme1737_i2c_detect,
2321 .address_data = &addr_data, 2321 .address_list = normal_i2c,
2322}; 2322};
2323 2323
2324/* --------------------------------------------------------------------- 2324/* ---------------------------------------------------------------------
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index 5fde2f5139fd..dfa4329090d4 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -321,7 +321,7 @@ static struct i2c_driver ds1621_driver = {
321 .remove = ds1621_remove, 321 .remove = ds1621_remove,
322 .id_table = ds1621_id, 322 .id_table = ds1621_id,
323 .detect = ds1621_detect, 323 .detect = ds1621_detect,
324 .address_data = &addr_data, 324 .address_list = normal_i2c,
325}; 325};
326 326
327static int __init ds1621_init(void) 327static int __init ds1621_init(void)
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index 2ffcf56b6f4e..f8992c935666 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -135,7 +135,7 @@ static struct i2c_driver f75375_driver = {
135 .remove = f75375_remove, 135 .remove = f75375_remove,
136 .id_table = f75375_id, 136 .id_table = f75375_id,
137 .detect = f75375_detect, 137 .detect = f75375_detect,
138 .address_data = &addr_data, 138 .address_list = normal_i2c,
139}; 139};
140 140
141static inline int f75375_read8(struct i2c_client *client, u8 reg) 141static inline int f75375_read8(struct i2c_client *client, u8 reg)
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index bce18e0f1d61..4eebbbeba2d1 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -251,7 +251,7 @@ static struct i2c_driver fschmd_driver = {
251 .remove = fschmd_remove, 251 .remove = fschmd_remove,
252 .id_table = fschmd_id, 252 .id_table = fschmd_id,
253 .detect = fschmd_detect, 253 .detect = fschmd_detect,
254 .address_data = &addr_data, 254 .address_list = normal_i2c,
255}; 255};
256 256
257/* 257/*
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c
index 34f83c6a3f45..e9407acd72cb 100644
--- a/drivers/hwmon/gl518sm.c
+++ b/drivers/hwmon/gl518sm.c
@@ -162,7 +162,7 @@ static struct i2c_driver gl518_driver = {
162 .remove = gl518_remove, 162 .remove = gl518_remove,
163 .id_table = gl518_id, 163 .id_table = gl518_id,
164 .detect = gl518_detect, 164 .detect = gl518_detect,
165 .address_data = &addr_data, 165 .address_list = normal_i2c,
166}; 166};
167 167
168/* 168/*
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
index d03ba692fc42..c0ec8c28731e 100644
--- a/drivers/hwmon/gl520sm.c
+++ b/drivers/hwmon/gl520sm.c
@@ -104,7 +104,7 @@ static struct i2c_driver gl520_driver = {
104 .remove = gl520_remove, 104 .remove = gl520_remove,
105 .id_table = gl520_id, 105 .id_table = gl520_id,
106 .detect = gl520_detect, 106 .detect = gl520_detect,
107 .address_data = &addr_data, 107 .address_list = normal_i2c,
108}; 108};
109 109
110/* Client data */ 110/* Client data */
diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
index 26844fc4a66d..1426a455071c 100644
--- a/drivers/hwmon/lm63.c
+++ b/drivers/hwmon/lm63.c
@@ -156,7 +156,7 @@ static struct i2c_driver lm63_driver = {
156 .remove = lm63_remove, 156 .remove = lm63_remove,
157 .id_table = lm63_id, 157 .id_table = lm63_id,
158 .detect = lm63_detect, 158 .detect = lm63_detect,
159 .address_data = &addr_data, 159 .address_list = normal_i2c,
160}; 160};
161 161
162/* 162/*
diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c
index e610da9bd80c..fb6ab9a9a608 100644
--- a/drivers/hwmon/lm73.c
+++ b/drivers/hwmon/lm73.c
@@ -182,7 +182,7 @@ static struct i2c_driver lm73_driver = {
182 .remove = lm73_remove, 182 .remove = lm73_remove,
183 .id_table = lm73_ids, 183 .id_table = lm73_ids,
184 .detect = lm73_detect, 184 .detect = lm73_detect,
185 .address_data = &addr_data, 185 .address_list = normal_i2c,
186}; 186};
187 187
188/* module glue */ 188/* module glue */
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 8fd759d28ddf..ce2423cd8198 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -295,7 +295,7 @@ static struct i2c_driver lm75_driver = {
295 .remove = lm75_remove, 295 .remove = lm75_remove,
296 .id_table = lm75_ids, 296 .id_table = lm75_ids,
297 .detect = lm75_detect, 297 .detect = lm75_detect,
298 .address_data = &addr_data, 298 .address_list = normal_i2c,
299}; 299};
300 300
301/*-----------------------------------------------------------------------*/ 301/*-----------------------------------------------------------------------*/
diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c
index 6373ab2cd952..b6105e570b0e 100644
--- a/drivers/hwmon/lm77.c
+++ b/drivers/hwmon/lm77.c
@@ -91,7 +91,7 @@ static struct i2c_driver lm77_driver = {
91 .remove = lm77_remove, 91 .remove = lm77_remove,
92 .id_table = lm77_id, 92 .id_table = lm77_id,
93 .detect = lm77_detect, 93 .detect = lm77_detect,
94 .address_data = &addr_data, 94 .address_list = normal_i2c,
95}; 95};
96 96
97/* straight from the datasheet */ 97/* straight from the datasheet */
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index f58850a9d9e0..cd6a9ea921f6 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -173,7 +173,7 @@ static struct i2c_driver lm78_driver = {
173 .remove = lm78_i2c_remove, 173 .remove = lm78_i2c_remove,
174 .id_table = lm78_i2c_id, 174 .id_table = lm78_i2c_id,
175 .detect = lm78_i2c_detect, 175 .detect = lm78_i2c_detect,
176 .address_data = &addr_data, 176 .address_list = normal_i2c,
177}; 177};
178 178
179static struct platform_driver lm78_isa_driver = { 179static struct platform_driver lm78_isa_driver = {
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
index e3222f3d4a5e..1cf5ff5bfa43 100644
--- a/drivers/hwmon/lm80.c
+++ b/drivers/hwmon/lm80.c
@@ -159,7 +159,7 @@ static struct i2c_driver lm80_driver = {
159 .remove = lm80_remove, 159 .remove = lm80_remove,
160 .id_table = lm80_id, 160 .id_table = lm80_id,
161 .detect = lm80_detect, 161 .detect = lm80_detect,
162 .address_data = &addr_data, 162 .address_list = normal_i2c,
163}; 163};
164 164
165/* 165/*
diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c
index bfb7477cb6b3..b80ae182f851 100644
--- a/drivers/hwmon/lm83.c
+++ b/drivers/hwmon/lm83.c
@@ -145,7 +145,7 @@ static struct i2c_driver lm83_driver = {
145 .remove = lm83_remove, 145 .remove = lm83_remove,
146 .id_table = lm83_id, 146 .id_table = lm83_id,
147 .detect = lm83_detect, 147 .detect = lm83_detect,
148 .address_data = &addr_data, 148 .address_list = normal_i2c,
149}; 149};
150 150
151/* 151/*
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
index f5fc45ac6fe5..d29bd34a265e 100644
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -356,7 +356,7 @@ static struct i2c_driver lm85_driver = {
356 .remove = lm85_remove, 356 .remove = lm85_remove,
357 .id_table = lm85_id, 357 .id_table = lm85_id,
358 .detect = lm85_detect, 358 .detect = lm85_detect,
359 .address_data = &addr_data, 359 .address_list = normal_i2c,
360}; 360};
361 361
362 362
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index d545b8596b05..60d34bc578cb 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -184,7 +184,7 @@ static struct i2c_driver lm87_driver = {
184 .remove = lm87_remove, 184 .remove = lm87_remove,
185 .id_table = lm87_id, 185 .id_table = lm87_id,
186 .detect = lm87_detect, 186 .detect = lm87_detect,
187 .address_data = &addr_data, 187 .address_list = normal_i2c,
188}; 188};
189 189
190/* 190/*
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 3acbacadac77..3e916ac97ea8 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -191,7 +191,7 @@ static struct i2c_driver lm90_driver = {
191 .remove = lm90_remove, 191 .remove = lm90_remove,
192 .id_table = lm90_id, 192 .id_table = lm90_id,
193 .detect = lm90_detect, 193 .detect = lm90_detect,
194 .address_data = &addr_data, 194 .address_list = normal_i2c,
195}; 195};
196 196
197/* 197/*
diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c
index da354222468d..b582b3b7fdee 100644
--- a/drivers/hwmon/lm92.c
+++ b/drivers/hwmon/lm92.c
@@ -416,7 +416,7 @@ static struct i2c_driver lm92_driver = {
416 .remove = lm92_remove, 416 .remove = lm92_remove,
417 .id_table = lm92_id, 417 .id_table = lm92_id,
418 .detect = lm92_detect, 418 .detect = lm92_detect,
419 .address_data = &addr_data, 419 .address_list = normal_i2c,
420}; 420};
421 421
422static int __init sensors_lm92_init(void) 422static int __init sensors_lm92_init(void)
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c
index 7b9c97b72eb8..d160dfdb513f 100644
--- a/drivers/hwmon/lm93.c
+++ b/drivers/hwmon/lm93.c
@@ -2616,7 +2616,7 @@ static struct i2c_driver lm93_driver = {
2616 .remove = lm93_remove, 2616 .remove = lm93_remove,
2617 .id_table = lm93_id, 2617 .id_table = lm93_id,
2618 .detect = lm93_detect, 2618 .detect = lm93_detect,
2619 .address_data = &addr_data, 2619 .address_list = normal_i2c,
2620}; 2620};
2621 2621
2622static int __init lm93_init(void) 2622static int __init lm93_init(void)
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c
index 05ede4137e22..55e3bfd49706 100644
--- a/drivers/hwmon/lm95241.c
+++ b/drivers/hwmon/lm95241.c
@@ -460,7 +460,7 @@ static struct i2c_driver lm95241_driver = {
460 .remove = lm95241_remove, 460 .remove = lm95241_remove,
461 .id_table = lm95241_id, 461 .id_table = lm95241_id,
462 .detect = lm95241_detect, 462 .detect = lm95241_detect,
463 .address_data = &addr_data, 463 .address_list = normal_i2c,
464}; 464};
465 465
466static int __init sensors_lm95241_init(void) 466static int __init sensors_lm95241_init(void)
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
index 4baf94efd372..94cea29f157b 100644
--- a/drivers/hwmon/max1619.c
+++ b/drivers/hwmon/max1619.c
@@ -113,7 +113,7 @@ static struct i2c_driver max1619_driver = {
113 .remove = max1619_remove, 113 .remove = max1619_remove,
114 .id_table = max1619_id, 114 .id_table = max1619_id,
115 .detect = max1619_detect, 115 .detect = max1619_detect,
116 .address_data = &addr_data, 116 .address_list = normal_i2c,
117}; 117};
118 118
119/* 119/*
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index fd5d1acfcc95..c7c126cf22dd 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -141,7 +141,7 @@ static struct i2c_driver max6650_driver = {
141 .remove = max6650_remove, 141 .remove = max6650_remove,
142 .id_table = max6650_id, 142 .id_table = max6650_id,
143 .detect = max6650_detect, 143 .detect = max6650_detect,
144 .address_data = &addr_data, 144 .address_list = normal_i2c,
145}; 145};
146 146
147/* 147/*
diff --git a/drivers/hwmon/pcf8591.c b/drivers/hwmon/pcf8591.c
index 4355aada01f2..c19e61bd393c 100644
--- a/drivers/hwmon/pcf8591.c
+++ b/drivers/hwmon/pcf8591.c
@@ -299,7 +299,7 @@ static struct i2c_driver pcf8591_driver = {
299 299
300 .class = I2C_CLASS_HWMON, /* Nearest choice */ 300 .class = I2C_CLASS_HWMON, /* Nearest choice */
301 .detect = pcf8591_detect, 301 .detect = pcf8591_detect,
302 .address_data = &addr_data, 302 .address_list = normal_i2c,
303}; 303};
304 304
305static int __init pcf8591_init(void) 305static int __init pcf8591_init(void)
diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c
index 1683fc76759f..34df2e2ee28a 100644
--- a/drivers/hwmon/smsc47m192.c
+++ b/drivers/hwmon/smsc47m192.c
@@ -135,7 +135,7 @@ static struct i2c_driver smsc47m192_driver = {
135 .remove = smsc47m192_remove, 135 .remove = smsc47m192_remove,
136 .id_table = smsc47m192_id, 136 .id_table = smsc47m192_id,
137 .detect = smsc47m192_detect, 137 .detect = smsc47m192_detect,
138 .address_data = &addr_data, 138 .address_list = normal_i2c,
139}; 139};
140 140
141/* Voltages */ 141/* Voltages */
diff --git a/drivers/hwmon/thmc50.c b/drivers/hwmon/thmc50.c
index 02ac0d4323a4..866d66507596 100644
--- a/drivers/hwmon/thmc50.c
+++ b/drivers/hwmon/thmc50.c
@@ -108,7 +108,7 @@ static struct i2c_driver thmc50_driver = {
108 .remove = thmc50_remove, 108 .remove = thmc50_remove,
109 .id_table = thmc50_id, 109 .id_table = thmc50_id,
110 .detect = thmc50_detect, 110 .detect = thmc50_detect,
111 .address_data = &addr_data, 111 .address_list = normal_i2c,
112}; 112};
113 113
114static ssize_t show_analog_out(struct device *dev, 114static ssize_t show_analog_out(struct device *dev,
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index 7cf1d541a5fa..ed086491cc9a 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -123,7 +123,7 @@ static struct i2c_driver tmp401_driver = {
123 .remove = tmp401_remove, 123 .remove = tmp401_remove,
124 .id_table = tmp401_id, 124 .id_table = tmp401_id,
125 .detect = tmp401_detect, 125 .detect = tmp401_detect,
126 .address_data = &addr_data, 126 .address_list = normal_i2c,
127}; 127};
128 128
129/* 129/*
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index 34eb34c548ff..018ad028c179 100644
--- a/drivers/hwmon/tmp421.c
+++ b/drivers/hwmon/tmp421.c
@@ -322,7 +322,7 @@ static struct i2c_driver tmp421_driver = {
322 .remove = tmp421_remove, 322 .remove = tmp421_remove,
323 .id_table = tmp421_id, 323 .id_table = tmp421_id,
324 .detect = tmp421_detect, 324 .detect = tmp421_detect,
325 .address_data = &addr_data, 325 .address_list = normal_i2c,
326}; 326};
327 327
328static int __init tmp421_init(void) 328static int __init tmp421_init(void)
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index 44704d2dee63..bfaa888f6e47 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1536,7 +1536,7 @@ static struct i2c_driver w83781d_driver = {
1536 .remove = w83781d_remove, 1536 .remove = w83781d_remove,
1537 .id_table = w83781d_ids, 1537 .id_table = w83781d_ids,
1538 .detect = w83781d_detect, 1538 .detect = w83781d_detect,
1539 .address_data = &addr_data, 1539 .address_list = normal_i2c,
1540}; 1540};
1541 1541
1542/* 1542/*
diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
index b3e91b6e651a..e059cf0471b0 100644
--- a/drivers/hwmon/w83791d.c
+++ b/drivers/hwmon/w83791d.c
@@ -355,7 +355,7 @@ static struct i2c_driver w83791d_driver = {
355 .remove = w83791d_remove, 355 .remove = w83791d_remove,
356 .id_table = w83791d_id, 356 .id_table = w83791d_id,
357 .detect = w83791d_detect, 357 .detect = w83791d_detect,
358 .address_data = &addr_data, 358 .address_list = normal_i2c,
359}; 359};
360 360
361/* following are the sysfs callback functions */ 361/* following are the sysfs callback functions */
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
index 03b836cdafa6..c6f198a3d924 100644
--- a/drivers/hwmon/w83792d.c
+++ b/drivers/hwmon/w83792d.c
@@ -328,7 +328,7 @@ static struct i2c_driver w83792d_driver = {
328 .remove = w83792d_remove, 328 .remove = w83792d_remove,
329 .id_table = w83792d_id, 329 .id_table = w83792d_id,
330 .detect = w83792d_detect, 330 .detect = w83792d_detect,
331 .address_data = &addr_data, 331 .address_list = normal_i2c,
332}; 332};
333 333
334static inline long in_count_from_reg(int nr, struct w83792d_data *data) 334static inline long in_count_from_reg(int nr, struct w83792d_data *data)
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index acf35e6e2ab9..ed32b18fbc42 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -252,7 +252,7 @@ static struct i2c_driver w83793_driver = {
252 .remove = w83793_remove, 252 .remove = w83793_remove,
253 .id_table = w83793_id, 253 .id_table = w83793_id,
254 .detect = w83793_detect, 254 .detect = w83793_detect,
255 .address_data = &addr_data, 255 .address_list = normal_i2c,
256}; 256};
257 257
258static ssize_t 258static ssize_t
diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c
index ec6e4b7fb741..81c59937cf0d 100644
--- a/drivers/hwmon/w83l785ts.c
+++ b/drivers/hwmon/w83l785ts.c
@@ -108,7 +108,7 @@ static struct i2c_driver w83l785ts_driver = {
108 .remove = w83l785ts_remove, 108 .remove = w83l785ts_remove,
109 .id_table = w83l785ts_id, 109 .id_table = w83l785ts_id,
110 .detect = w83l785ts_detect, 110 .detect = w83l785ts_detect,
111 .address_data = &addr_data, 111 .address_list = normal_i2c,
112}; 112};
113 113
114/* 114/*
diff --git a/drivers/hwmon/w83l786ng.c b/drivers/hwmon/w83l786ng.c
index 12a5fd67bee0..a427347ae82b 100644
--- a/drivers/hwmon/w83l786ng.c
+++ b/drivers/hwmon/w83l786ng.c
@@ -168,7 +168,7 @@ static struct i2c_driver w83l786ng_driver = {
168 .remove = w83l786ng_remove, 168 .remove = w83l786ng_remove,
169 .id_table = w83l786ng_id, 169 .id_table = w83l786ng_id,
170 .detect = w83l786ng_detect, 170 .detect = w83l786ng_detect,
171 .address_data = &addr_data, 171 .address_list = normal_i2c,
172}; 172};
173 173
174static u8 174static u8
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index c1047d644d8f..9065c7238b5e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1214,13 +1214,13 @@ static int i2c_detect_address(struct i2c_client *temp_client,
1214 1214
1215static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) 1215static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
1216{ 1216{
1217 const struct i2c_client_address_data *address_data; 1217 const unsigned short *address_list;
1218 struct i2c_client *temp_client; 1218 struct i2c_client *temp_client;
1219 int i, err = 0; 1219 int i, err = 0;
1220 int adap_id = i2c_adapter_id(adapter); 1220 int adap_id = i2c_adapter_id(adapter);
1221 1221
1222 address_data = driver->address_data; 1222 address_list = driver->address_list;
1223 if (!driver->detect || !address_data) 1223 if (!driver->detect || !address_list)
1224 return 0; 1224 return 0;
1225 1225
1226 /* Set up a temporary client to help detect callback */ 1226 /* Set up a temporary client to help detect callback */
@@ -1235,7 +1235,7 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
1235 1235
1236 /* Stop here if we can't use SMBUS_QUICK */ 1236 /* Stop here if we can't use SMBUS_QUICK */
1237 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { 1237 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) {
1238 if (address_data->normal_i2c[0] == I2C_CLIENT_END) 1238 if (address_list[0] == I2C_CLIENT_END)
1239 goto exit_free; 1239 goto exit_free;
1240 1240
1241 dev_warn(&adapter->dev, "SMBus Quick command not supported, " 1241 dev_warn(&adapter->dev, "SMBus Quick command not supported, "
@@ -1244,11 +1244,10 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
1244 goto exit_free; 1244 goto exit_free;
1245 } 1245 }
1246 1246
1247 for (i = 0; address_data->normal_i2c[i] != I2C_CLIENT_END; i += 1) { 1247 for (i = 0; address_list[i] != I2C_CLIENT_END; i += 1) {
1248 dev_dbg(&adapter->dev, "found normal entry for adapter %d, " 1248 dev_dbg(&adapter->dev, "found normal entry for adapter %d, "
1249 "addr 0x%02x\n", adap_id, 1249 "addr 0x%02x\n", adap_id, address_list[i]);
1250 address_data->normal_i2c[i]); 1250 temp_client->addr = address_list[i];
1251 temp_client->addr = address_data->normal_i2c[i];
1252 err = i2c_detect_address(temp_client, driver); 1251 err = i2c_detect_address(temp_client, driver);
1253 if (err) 1252 if (err)
1254 goto exit_free; 1253 goto exit_free;
diff --git a/drivers/misc/eeprom/eeprom.c b/drivers/misc/eeprom/eeprom.c
index 2c428f464539..3dc5e3db2c12 100644
--- a/drivers/misc/eeprom/eeprom.c
+++ b/drivers/misc/eeprom/eeprom.c
@@ -232,7 +232,7 @@ static struct i2c_driver eeprom_driver = {
232 232
233 .class = I2C_CLASS_DDC | I2C_CLASS_SPD, 233 .class = I2C_CLASS_DDC | I2C_CLASS_SPD,
234 .detect = eeprom_detect, 234 .detect = eeprom_detect,
235 .address_data = &addr_data, 235 .address_list = normal_i2c,
236}; 236};
237 237
238static int __init eeprom_init(void) 238static int __init eeprom_init(void)
diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c
index 75097ec43edd..d8a84718d687 100644
--- a/drivers/misc/ics932s401.c
+++ b/drivers/misc/ics932s401.c
@@ -125,7 +125,7 @@ static struct i2c_driver ics932s401_driver = {
125 .remove = ics932s401_remove, 125 .remove = ics932s401_remove,
126 .id_table = ics932s401_id, 126 .id_table = ics932s401_id,
127 .detect = ics932s401_detect, 127 .detect = ics932s401_detect,
128 .address_data = &addr_data, 128 .address_list = normal_i2c,
129}; 129};
130 130
131static struct ics932s401_data *ics932s401_update_device(struct device *dev) 131static struct ics932s401_data *ics932s401_update_device(struct device *dev)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index f6f2c080ba67..fb9df1416ad5 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -110,7 +110,7 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
110 * @driver: Device driver model driver 110 * @driver: Device driver model driver
111 * @id_table: List of I2C devices supported by this driver 111 * @id_table: List of I2C devices supported by this driver
112 * @detect: Callback for device detection 112 * @detect: Callback for device detection
113 * @address_data: The I2C addresses to probe (for detect) 113 * @address_list: The I2C addresses to probe (for detect)
114 * @clients: List of detected clients we created (for i2c-core use only) 114 * @clients: List of detected clients we created (for i2c-core use only)
115 * 115 *
116 * The driver.owner field should be set to the module owner of this driver. 116 * The driver.owner field should be set to the module owner of this driver.
@@ -162,7 +162,7 @@ struct i2c_driver {
162 162
163 /* Device detection callback for automatic device creation */ 163 /* Device detection callback for automatic device creation */
164 int (*detect)(struct i2c_client *, struct i2c_board_info *); 164 int (*detect)(struct i2c_client *, struct i2c_board_info *);
165 const struct i2c_client_address_data *address_data; 165 const unsigned short *address_list;
166 struct list_head clients; 166 struct list_head clients;
167}; 167};
168#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) 168#define to_i2c_driver(d) container_of(d, struct i2c_driver, driver)
@@ -391,14 +391,6 @@ static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
391#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ 391#define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */
392#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ 392#define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */
393 393
394/* i2c_client_address_data is the struct for holding default client
395 * addresses for a driver and for the parameters supplied on the
396 * command line
397 */
398struct i2c_client_address_data {
399 const unsigned short *normal_i2c;
400};
401
402/* Internal numbers to terminate lists */ 394/* Internal numbers to terminate lists */
403#define I2C_CLIENT_END 0xfffeU 395#define I2C_CLIENT_END 0xfffeU
404 396
@@ -610,48 +602,34 @@ union i2c_smbus_data {
610 module_param_array(var, short, &var##_num, 0); \ 602 module_param_array(var, short, &var##_num, 0); \
611 MODULE_PARM_DESC(var, desc) 603 MODULE_PARM_DESC(var, desc)
612 604
613#define I2C_CLIENT_INSMOD_COMMON \
614static const struct i2c_client_address_data addr_data = { \
615 .normal_i2c = normal_i2c, \
616}
617
618/* These are the ones you want to use in your own drivers. Pick the one 605/* These are the ones you want to use in your own drivers. Pick the one
619 which matches the number of devices the driver differenciates between. */ 606 which matches the number of devices the driver differenciates between. */
620#define I2C_CLIENT_INSMOD \ 607#define I2C_CLIENT_INSMOD
621I2C_CLIENT_INSMOD_COMMON
622 608
623#define I2C_CLIENT_INSMOD_1(chip1) \ 609#define I2C_CLIENT_INSMOD_1(chip1) \
624enum chips { any_chip, chip1 }; \ 610enum chips { any_chip, chip1 }
625I2C_CLIENT_INSMOD_COMMON
626 611
627#define I2C_CLIENT_INSMOD_2(chip1, chip2) \ 612#define I2C_CLIENT_INSMOD_2(chip1, chip2) \
628enum chips { any_chip, chip1, chip2 }; \ 613enum chips { any_chip, chip1, chip2 }
629I2C_CLIENT_INSMOD_COMMON
630 614
631#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ 615#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \
632enum chips { any_chip, chip1, chip2, chip3 }; \ 616enum chips { any_chip, chip1, chip2, chip3 }
633I2C_CLIENT_INSMOD_COMMON
634 617
635#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ 618#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \
636enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ 619enum chips { any_chip, chip1, chip2, chip3, chip4 }
637I2C_CLIENT_INSMOD_COMMON
638 620
639#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ 621#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \
640enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ 622enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }
641I2C_CLIENT_INSMOD_COMMON
642 623
643#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ 624#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \
644enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ 625enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }
645I2C_CLIENT_INSMOD_COMMON
646 626
647#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ 627#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \
648enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ 628enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
649 chip7 }; \ 629 chip7 }
650I2C_CLIENT_INSMOD_COMMON
651 630
652#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ 631#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \
653enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ 632enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
654 chip7, chip8 }; \ 633 chip7, chip8 }
655I2C_CLIENT_INSMOD_COMMON
656#endif /* __KERNEL__ */ 634#endif /* __KERNEL__ */
657#endif /* _LINUX_I2C_H */ 635#endif /* _LINUX_I2C_H */