diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-04-20 02:30:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 13:43:14 -0400 |
commit | d51dbecc85618a75ec0c76dad27c45d9b8d64c66 (patch) | |
tree | 0fbe188573c97604c85dcfd96c4bf4dab9bdbcf9 /drivers/media/dvb/dvb-usb/dw2102.c | |
parent | 9346459ae0317ec6a6930b4566417e033f74a2bf (diff) |
[media] dw2102: fix compile warnings
media_build/v4l/dw2102.c:151:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/dw2102.c:224:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/dw2102.c:279:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/dw2102.c:352:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/dw2102.c:435:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/dw2102.c:499:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dw2102.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dw2102.c | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index 451c5a7adfb2..9382895b1b88 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c | |||
@@ -148,7 +148,7 @@ static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
148 | int num) | 148 | int num) |
149 | { | 149 | { |
150 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 150 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
151 | int i = 0, ret = 0; | 151 | int i = 0; |
152 | u8 buf6[] = {0x2c, 0x05, 0xc0, 0, 0, 0, 0}; | 152 | u8 buf6[] = {0x2c, 0x05, 0xc0, 0, 0, 0, 0}; |
153 | u16 value; | 153 | u16 value; |
154 | 154 | ||
@@ -162,7 +162,7 @@ static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
162 | /* read stv0299 register */ | 162 | /* read stv0299 register */ |
163 | value = msg[0].buf[0];/* register */ | 163 | value = msg[0].buf[0];/* register */ |
164 | for (i = 0; i < msg[1].len; i++) { | 164 | for (i = 0; i < msg[1].len; i++) { |
165 | ret = dw210x_op_rw(d->udev, 0xb5, value + i, 0, | 165 | dw210x_op_rw(d->udev, 0xb5, value + i, 0, |
166 | buf6, 2, DW210X_READ_MSG); | 166 | buf6, 2, DW210X_READ_MSG); |
167 | msg[1].buf[i] = buf6[0]; | 167 | msg[1].buf[i] = buf6[0]; |
168 | } | 168 | } |
@@ -174,7 +174,7 @@ static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
174 | buf6[0] = 0x2a; | 174 | buf6[0] = 0x2a; |
175 | buf6[1] = msg[0].buf[0]; | 175 | buf6[1] = msg[0].buf[0]; |
176 | buf6[2] = msg[0].buf[1]; | 176 | buf6[2] = msg[0].buf[1]; |
177 | ret = dw210x_op_rw(d->udev, 0xb2, 0, 0, | 177 | dw210x_op_rw(d->udev, 0xb2, 0, 0, |
178 | buf6, 3, DW210X_WRITE_MSG); | 178 | buf6, 3, DW210X_WRITE_MSG); |
179 | break; | 179 | break; |
180 | case 0x60: | 180 | case 0x60: |
@@ -187,17 +187,17 @@ static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
187 | buf6[4] = msg[0].buf[1]; | 187 | buf6[4] = msg[0].buf[1]; |
188 | buf6[5] = msg[0].buf[2]; | 188 | buf6[5] = msg[0].buf[2]; |
189 | buf6[6] = msg[0].buf[3]; | 189 | buf6[6] = msg[0].buf[3]; |
190 | ret = dw210x_op_rw(d->udev, 0xb2, 0, 0, | 190 | dw210x_op_rw(d->udev, 0xb2, 0, 0, |
191 | buf6, 7, DW210X_WRITE_MSG); | 191 | buf6, 7, DW210X_WRITE_MSG); |
192 | } else { | 192 | } else { |
193 | /* read from tuner */ | 193 | /* read from tuner */ |
194 | ret = dw210x_op_rw(d->udev, 0xb5, 0, 0, | 194 | dw210x_op_rw(d->udev, 0xb5, 0, 0, |
195 | buf6, 1, DW210X_READ_MSG); | 195 | buf6, 1, DW210X_READ_MSG); |
196 | msg[0].buf[0] = buf6[0]; | 196 | msg[0].buf[0] = buf6[0]; |
197 | } | 197 | } |
198 | break; | 198 | break; |
199 | case (DW2102_RC_QUERY): | 199 | case (DW2102_RC_QUERY): |
200 | ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, | 200 | dw210x_op_rw(d->udev, 0xb8, 0, 0, |
201 | buf6, 2, DW210X_READ_MSG); | 201 | buf6, 2, DW210X_READ_MSG); |
202 | msg[0].buf[0] = buf6[0]; | 202 | msg[0].buf[0] = buf6[0]; |
203 | msg[0].buf[1] = buf6[1]; | 203 | msg[0].buf[1] = buf6[1]; |
@@ -205,7 +205,7 @@ static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
205 | case (DW2102_VOLTAGE_CTRL): | 205 | case (DW2102_VOLTAGE_CTRL): |
206 | buf6[0] = 0x30; | 206 | buf6[0] = 0x30; |
207 | buf6[1] = msg[0].buf[0]; | 207 | buf6[1] = msg[0].buf[0]; |
208 | ret = dw210x_op_rw(d->udev, 0xb2, 0, 0, | 208 | dw210x_op_rw(d->udev, 0xb2, 0, 0, |
209 | buf6, 2, DW210X_WRITE_MSG); | 209 | buf6, 2, DW210X_WRITE_MSG); |
210 | break; | 210 | break; |
211 | } | 211 | } |
@@ -221,7 +221,6 @@ static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap, | |||
221 | struct i2c_msg msg[], int num) | 221 | struct i2c_msg msg[], int num) |
222 | { | 222 | { |
223 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 223 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
224 | int ret = 0; | ||
225 | u8 buf6[] = {0, 0, 0, 0, 0, 0, 0}; | 224 | u8 buf6[] = {0, 0, 0, 0, 0, 0, 0}; |
226 | 225 | ||
227 | if (!d) | 226 | if (!d) |
@@ -235,10 +234,10 @@ static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap, | |||
235 | buf6[0] = msg[0].addr << 1; | 234 | buf6[0] = msg[0].addr << 1; |
236 | buf6[1] = msg[0].len; | 235 | buf6[1] = msg[0].len; |
237 | buf6[2] = msg[0].buf[0]; | 236 | buf6[2] = msg[0].buf[0]; |
238 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 237 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
239 | buf6, msg[0].len + 2, DW210X_WRITE_MSG); | 238 | buf6, msg[0].len + 2, DW210X_WRITE_MSG); |
240 | /* read si2109 register */ | 239 | /* read si2109 register */ |
241 | ret = dw210x_op_rw(d->udev, 0xc3, 0xd0, 0, | 240 | dw210x_op_rw(d->udev, 0xc3, 0xd0, 0, |
242 | buf6, msg[1].len + 2, DW210X_READ_MSG); | 241 | buf6, msg[1].len + 2, DW210X_READ_MSG); |
243 | memcpy(msg[1].buf, buf6 + 2, msg[1].len); | 242 | memcpy(msg[1].buf, buf6 + 2, msg[1].len); |
244 | 243 | ||
@@ -250,11 +249,11 @@ static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap, | |||
250 | buf6[0] = msg[0].addr << 1; | 249 | buf6[0] = msg[0].addr << 1; |
251 | buf6[1] = msg[0].len; | 250 | buf6[1] = msg[0].len; |
252 | memcpy(buf6 + 2, msg[0].buf, msg[0].len); | 251 | memcpy(buf6 + 2, msg[0].buf, msg[0].len); |
253 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, buf6, | 252 | dw210x_op_rw(d->udev, 0xc2, 0, 0, buf6, |
254 | msg[0].len + 2, DW210X_WRITE_MSG); | 253 | msg[0].len + 2, DW210X_WRITE_MSG); |
255 | break; | 254 | break; |
256 | case(DW2102_RC_QUERY): | 255 | case(DW2102_RC_QUERY): |
257 | ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, | 256 | dw210x_op_rw(d->udev, 0xb8, 0, 0, |
258 | buf6, 2, DW210X_READ_MSG); | 257 | buf6, 2, DW210X_READ_MSG); |
259 | msg[0].buf[0] = buf6[0]; | 258 | msg[0].buf[0] = buf6[0]; |
260 | msg[0].buf[1] = buf6[1]; | 259 | msg[0].buf[1] = buf6[1]; |
@@ -262,7 +261,7 @@ static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap, | |||
262 | case(DW2102_VOLTAGE_CTRL): | 261 | case(DW2102_VOLTAGE_CTRL): |
263 | buf6[0] = 0x30; | 262 | buf6[0] = 0x30; |
264 | buf6[1] = msg[0].buf[0]; | 263 | buf6[1] = msg[0].buf[0]; |
265 | ret = dw210x_op_rw(d->udev, 0xb2, 0, 0, | 264 | dw210x_op_rw(d->udev, 0xb2, 0, 0, |
266 | buf6, 2, DW210X_WRITE_MSG); | 265 | buf6, 2, DW210X_WRITE_MSG); |
267 | break; | 266 | break; |
268 | } | 267 | } |
@@ -276,7 +275,6 @@ static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap, | |||
276 | static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) | 275 | static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) |
277 | { | 276 | { |
278 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 277 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
279 | int ret = 0; | ||
280 | 278 | ||
281 | if (!d) | 279 | if (!d) |
282 | return -ENODEV; | 280 | return -ENODEV; |
@@ -291,10 +289,10 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms | |||
291 | obuf[0] = msg[0].addr << 1; | 289 | obuf[0] = msg[0].addr << 1; |
292 | obuf[1] = msg[0].len; | 290 | obuf[1] = msg[0].len; |
293 | obuf[2] = msg[0].buf[0]; | 291 | obuf[2] = msg[0].buf[0]; |
294 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 292 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
295 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); | 293 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); |
296 | /* second read registers */ | 294 | /* second read registers */ |
297 | ret = dw210x_op_rw(d->udev, 0xc3, 0xd1 , 0, | 295 | dw210x_op_rw(d->udev, 0xc3, 0xd1 , 0, |
298 | ibuf, msg[1].len + 2, DW210X_READ_MSG); | 296 | ibuf, msg[1].len + 2, DW210X_READ_MSG); |
299 | memcpy(msg[1].buf, ibuf + 2, msg[1].len); | 297 | memcpy(msg[1].buf, ibuf + 2, msg[1].len); |
300 | 298 | ||
@@ -308,7 +306,7 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms | |||
308 | obuf[0] = msg[0].addr << 1; | 306 | obuf[0] = msg[0].addr << 1; |
309 | obuf[1] = msg[0].len; | 307 | obuf[1] = msg[0].len; |
310 | memcpy(obuf + 2, msg[0].buf, msg[0].len); | 308 | memcpy(obuf + 2, msg[0].buf, msg[0].len); |
311 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 309 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
312 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); | 310 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); |
313 | break; | 311 | break; |
314 | } | 312 | } |
@@ -318,13 +316,13 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms | |||
318 | obuf[0] = msg[0].addr << 1; | 316 | obuf[0] = msg[0].addr << 1; |
319 | obuf[1] = msg[0].len; | 317 | obuf[1] = msg[0].len; |
320 | memcpy(obuf + 2, msg[0].buf, msg[0].len); | 318 | memcpy(obuf + 2, msg[0].buf, msg[0].len); |
321 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 319 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
322 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); | 320 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); |
323 | break; | 321 | break; |
324 | } | 322 | } |
325 | case(DW2102_RC_QUERY): { | 323 | case(DW2102_RC_QUERY): { |
326 | u8 ibuf[2]; | 324 | u8 ibuf[2]; |
327 | ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, | 325 | dw210x_op_rw(d->udev, 0xb8, 0, 0, |
328 | ibuf, 2, DW210X_READ_MSG); | 326 | ibuf, 2, DW210X_READ_MSG); |
329 | memcpy(msg[0].buf, ibuf , 2); | 327 | memcpy(msg[0].buf, ibuf , 2); |
330 | break; | 328 | break; |
@@ -333,7 +331,7 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms | |||
333 | u8 obuf[2]; | 331 | u8 obuf[2]; |
334 | obuf[0] = 0x30; | 332 | obuf[0] = 0x30; |
335 | obuf[1] = msg[0].buf[0]; | 333 | obuf[1] = msg[0].buf[0]; |
336 | ret = dw210x_op_rw(d->udev, 0xb2, 0, 0, | 334 | dw210x_op_rw(d->udev, 0xb2, 0, 0, |
337 | obuf, 2, DW210X_WRITE_MSG); | 335 | obuf, 2, DW210X_WRITE_MSG); |
338 | break; | 336 | break; |
339 | } | 337 | } |
@@ -349,7 +347,6 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms | |||
349 | static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) | 347 | static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) |
350 | { | 348 | { |
351 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 349 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
352 | int ret = 0; | ||
353 | int len, i, j; | 350 | int len, i, j; |
354 | 351 | ||
355 | if (!d) | 352 | if (!d) |
@@ -361,7 +358,7 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i | |||
361 | switch (msg[j].addr) { | 358 | switch (msg[j].addr) { |
362 | case(DW2102_RC_QUERY): { | 359 | case(DW2102_RC_QUERY): { |
363 | u8 ibuf[2]; | 360 | u8 ibuf[2]; |
364 | ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, | 361 | dw210x_op_rw(d->udev, 0xb8, 0, 0, |
365 | ibuf, 2, DW210X_READ_MSG); | 362 | ibuf, 2, DW210X_READ_MSG); |
366 | memcpy(msg[j].buf, ibuf , 2); | 363 | memcpy(msg[j].buf, ibuf , 2); |
367 | break; | 364 | break; |
@@ -370,7 +367,7 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i | |||
370 | u8 obuf[2]; | 367 | u8 obuf[2]; |
371 | obuf[0] = 0x30; | 368 | obuf[0] = 0x30; |
372 | obuf[1] = msg[j].buf[0]; | 369 | obuf[1] = msg[j].buf[0]; |
373 | ret = dw210x_op_rw(d->udev, 0xb2, 0, 0, | 370 | dw210x_op_rw(d->udev, 0xb2, 0, 0, |
374 | obuf, 2, DW210X_WRITE_MSG); | 371 | obuf, 2, DW210X_WRITE_MSG); |
375 | break; | 372 | break; |
376 | } | 373 | } |
@@ -382,7 +379,7 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i | |||
382 | if (msg[j].flags == I2C_M_RD) { | 379 | if (msg[j].flags == I2C_M_RD) { |
383 | /* read registers */ | 380 | /* read registers */ |
384 | u8 ibuf[msg[j].len + 2]; | 381 | u8 ibuf[msg[j].len + 2]; |
385 | ret = dw210x_op_rw(d->udev, 0xc3, | 382 | dw210x_op_rw(d->udev, 0xc3, |
386 | (msg[j].addr << 1) + 1, 0, | 383 | (msg[j].addr << 1) + 1, 0, |
387 | ibuf, msg[j].len + 2, | 384 | ibuf, msg[j].len + 2, |
388 | DW210X_READ_MSG); | 385 | DW210X_READ_MSG); |
@@ -402,7 +399,7 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i | |||
402 | do { | 399 | do { |
403 | memcpy(obuf + 3, msg[j].buf + i, | 400 | memcpy(obuf + 3, msg[j].buf + i, |
404 | (len > 16 ? 16 : len)); | 401 | (len > 16 ? 16 : len)); |
405 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 402 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
406 | obuf, (len > 16 ? 16 : len) + 3, | 403 | obuf, (len > 16 ? 16 : len) + 3, |
407 | DW210X_WRITE_MSG); | 404 | DW210X_WRITE_MSG); |
408 | i += 16; | 405 | i += 16; |
@@ -414,7 +411,7 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i | |||
414 | obuf[0] = msg[j].addr << 1; | 411 | obuf[0] = msg[j].addr << 1; |
415 | obuf[1] = msg[j].len; | 412 | obuf[1] = msg[j].len; |
416 | memcpy(obuf + 2, msg[j].buf, msg[j].len); | 413 | memcpy(obuf + 2, msg[j].buf, msg[j].len); |
417 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 414 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
418 | obuf, msg[j].len + 2, | 415 | obuf, msg[j].len + 2, |
419 | DW210X_WRITE_MSG); | 416 | DW210X_WRITE_MSG); |
420 | } | 417 | } |
@@ -432,7 +429,7 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
432 | int num) | 429 | int num) |
433 | { | 430 | { |
434 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 431 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
435 | int ret = 0, i; | 432 | int i; |
436 | 433 | ||
437 | if (!d) | 434 | if (!d) |
438 | return -ENODEV; | 435 | return -ENODEV; |
@@ -447,10 +444,10 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
447 | obuf[0] = msg[0].addr << 1; | 444 | obuf[0] = msg[0].addr << 1; |
448 | obuf[1] = msg[0].len; | 445 | obuf[1] = msg[0].len; |
449 | obuf[2] = msg[0].buf[0]; | 446 | obuf[2] = msg[0].buf[0]; |
450 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 447 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
451 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); | 448 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); |
452 | /* second read registers */ | 449 | /* second read registers */ |
453 | ret = dw210x_op_rw(d->udev, 0xc3, 0x19 , 0, | 450 | dw210x_op_rw(d->udev, 0xc3, 0x19 , 0, |
454 | ibuf, msg[1].len + 2, DW210X_READ_MSG); | 451 | ibuf, msg[1].len + 2, DW210X_READ_MSG); |
455 | memcpy(msg[1].buf, ibuf + 2, msg[1].len); | 452 | memcpy(msg[1].buf, ibuf + 2, msg[1].len); |
456 | 453 | ||
@@ -465,13 +462,13 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
465 | obuf[0] = msg[0].addr << 1; | 462 | obuf[0] = msg[0].addr << 1; |
466 | obuf[1] = msg[0].len; | 463 | obuf[1] = msg[0].len; |
467 | memcpy(obuf + 2, msg[0].buf, msg[0].len); | 464 | memcpy(obuf + 2, msg[0].buf, msg[0].len); |
468 | ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, | 465 | dw210x_op_rw(d->udev, 0xc2, 0, 0, |
469 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); | 466 | obuf, msg[0].len + 2, DW210X_WRITE_MSG); |
470 | break; | 467 | break; |
471 | } | 468 | } |
472 | case(DW2102_RC_QUERY): { | 469 | case(DW2102_RC_QUERY): { |
473 | u8 ibuf[2]; | 470 | u8 ibuf[2]; |
474 | ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, | 471 | dw210x_op_rw(d->udev, 0xb8, 0, 0, |
475 | ibuf, 2, DW210X_READ_MSG); | 472 | ibuf, 2, DW210X_READ_MSG); |
476 | memcpy(msg[0].buf, ibuf , 2); | 473 | memcpy(msg[0].buf, ibuf , 2); |
477 | break; | 474 | break; |
@@ -496,7 +493,6 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
496 | { | 493 | { |
497 | struct dvb_usb_device *d = i2c_get_adapdata(adap); | 494 | struct dvb_usb_device *d = i2c_get_adapdata(adap); |
498 | struct usb_device *udev; | 495 | struct usb_device *udev; |
499 | int ret = 0; | ||
500 | int len, i, j; | 496 | int len, i, j; |
501 | 497 | ||
502 | if (!d) | 498 | if (!d) |
@@ -509,7 +505,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
509 | switch (msg[j].addr) { | 505 | switch (msg[j].addr) { |
510 | case (DW2102_RC_QUERY): { | 506 | case (DW2102_RC_QUERY): { |
511 | u8 ibuf[5]; | 507 | u8 ibuf[5]; |
512 | ret = dw210x_op_rw(d->udev, 0xb8, 0, 0, | 508 | dw210x_op_rw(d->udev, 0xb8, 0, 0, |
513 | ibuf, 5, DW210X_READ_MSG); | 509 | ibuf, 5, DW210X_READ_MSG); |
514 | memcpy(msg[j].buf, ibuf + 3, 2); | 510 | memcpy(msg[j].buf, ibuf + 3, 2); |
515 | break; | 511 | break; |
@@ -519,11 +515,11 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
519 | 515 | ||
520 | obuf[0] = 1; | 516 | obuf[0] = 1; |
521 | obuf[1] = msg[j].buf[1];/* off-on */ | 517 | obuf[1] = msg[j].buf[1];/* off-on */ |
522 | ret = dw210x_op_rw(d->udev, 0x8a, 0, 0, | 518 | dw210x_op_rw(d->udev, 0x8a, 0, 0, |
523 | obuf, 2, DW210X_WRITE_MSG); | 519 | obuf, 2, DW210X_WRITE_MSG); |
524 | obuf[0] = 3; | 520 | obuf[0] = 3; |
525 | obuf[1] = msg[j].buf[0];/* 13v-18v */ | 521 | obuf[1] = msg[j].buf[0];/* 13v-18v */ |
526 | ret = dw210x_op_rw(d->udev, 0x8a, 0, 0, | 522 | dw210x_op_rw(d->udev, 0x8a, 0, 0, |
527 | obuf, 2, DW210X_WRITE_MSG); | 523 | obuf, 2, DW210X_WRITE_MSG); |
528 | break; | 524 | break; |
529 | } | 525 | } |
@@ -532,7 +528,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
532 | 528 | ||
533 | obuf[0] = 5; | 529 | obuf[0] = 5; |
534 | obuf[1] = msg[j].buf[0]; | 530 | obuf[1] = msg[j].buf[0]; |
535 | ret = dw210x_op_rw(d->udev, 0x8a, 0, 0, | 531 | dw210x_op_rw(d->udev, 0x8a, 0, 0, |
536 | obuf, 2, DW210X_WRITE_MSG); | 532 | obuf, 2, DW210X_WRITE_MSG); |
537 | break; | 533 | break; |
538 | } | 534 | } |
@@ -545,7 +541,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
545 | if (msg[j].flags == I2C_M_RD) { | 541 | if (msg[j].flags == I2C_M_RD) { |
546 | /* read registers */ | 542 | /* read registers */ |
547 | u8 ibuf[msg[j].len]; | 543 | u8 ibuf[msg[j].len]; |
548 | ret = dw210x_op_rw(d->udev, 0x91, 0, 0, | 544 | dw210x_op_rw(d->udev, 0x91, 0, 0, |
549 | ibuf, msg[j].len, | 545 | ibuf, msg[j].len, |
550 | DW210X_READ_MSG); | 546 | DW210X_READ_MSG); |
551 | memcpy(msg[j].buf, ibuf, msg[j].len); | 547 | memcpy(msg[j].buf, ibuf, msg[j].len); |
@@ -563,7 +559,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
563 | do { | 559 | do { |
564 | memcpy(obuf + 3, msg[j].buf + i, | 560 | memcpy(obuf + 3, msg[j].buf + i, |
565 | (len > 16 ? 16 : len)); | 561 | (len > 16 ? 16 : len)); |
566 | ret = dw210x_op_rw(d->udev, 0x80, 0, 0, | 562 | dw210x_op_rw(d->udev, 0x80, 0, 0, |
567 | obuf, (len > 16 ? 16 : len) + 3, | 563 | obuf, (len > 16 ? 16 : len) + 3, |
568 | DW210X_WRITE_MSG); | 564 | DW210X_WRITE_MSG); |
569 | i += 16; | 565 | i += 16; |
@@ -575,7 +571,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
575 | obuf[0] = msg[j + 1].len; | 571 | obuf[0] = msg[j + 1].len; |
576 | obuf[1] = (msg[j].addr << 1); | 572 | obuf[1] = (msg[j].addr << 1); |
577 | memcpy(obuf + 2, msg[j].buf, msg[j].len); | 573 | memcpy(obuf + 2, msg[j].buf, msg[j].len); |
578 | ret = dw210x_op_rw(d->udev, | 574 | dw210x_op_rw(d->udev, |
579 | udev->descriptor.idProduct == | 575 | udev->descriptor.idProduct == |
580 | 0x7500 ? 0x92 : 0x90, 0, 0, | 576 | 0x7500 ? 0x92 : 0x90, 0, 0, |
581 | obuf, msg[j].len + 2, | 577 | obuf, msg[j].len + 2, |
@@ -587,7 +583,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
587 | obuf[0] = msg[j].len + 1; | 583 | obuf[0] = msg[j].len + 1; |
588 | obuf[1] = (msg[j].addr << 1); | 584 | obuf[1] = (msg[j].addr << 1); |
589 | memcpy(obuf + 2, msg[j].buf, msg[j].len); | 585 | memcpy(obuf + 2, msg[j].buf, msg[j].len); |
590 | ret = dw210x_op_rw(d->udev, 0x80, 0, 0, | 586 | dw210x_op_rw(d->udev, 0x80, 0, 0, |
591 | obuf, msg[j].len + 2, | 587 | obuf, msg[j].len + 2, |
592 | DW210X_WRITE_MSG); | 588 | DW210X_WRITE_MSG); |
593 | break; | 589 | break; |