Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (3575): Cxusb: fix i2c debug messages for bluebird devices

Only the Medion boxes return 0x08 after an i2c read/write.
The bluebird devices do not return anything at all.
This patch conditionalizes the test for the 0x08 return code
to produce a warning message when using the Medion box, only.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Michael Krufky and committed by
Mauro Carvalho Chehab
ae62e3d4 4d6e772d

+4 -2
+2 -2
drivers/media/dvb/dvb-usb/cxusb.c
··· 109 109 break; 110 110 111 111 if (ibuf[0] != 0x08) 112 - deb_info("i2c read may have failed\n"); 112 + deb_i2c("i2c read may have failed\n"); 113 113 114 114 memcpy(msg[i+1].buf,&ibuf[1],msg[i+1].len); 115 115 ··· 123 123 if (cxusb_ctrl_msg(d,CMD_I2C_WRITE, obuf, 2+msg[i].len, &ibuf,1) < 0) 124 124 break; 125 125 if (ibuf != 0x08) 126 - deb_info("i2c write may have failed\n"); 126 + deb_i2c("i2c write may have failed\n"); 127 127 } 128 128 } 129 129
+2
drivers/media/dvb/dvb-usb/cxusb.h
··· 6 6 7 7 extern int dvb_usb_cxusb_debug; 8 8 #define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args) 9 + #define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \ 10 + dprintk(dvb_usb_cxusb_debug,0x01,args) 9 11 10 12 /* usb commands - some of it are guesses, don't have a reference yet */ 11 13 #define CMD_I2C_WRITE 0x08