aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@iki.fi>2011-08-06 17:18:10 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-22 09:52:35 -0400
commit0224e0401f0b18e1f5fce010558b12fc24257e37 (patch)
tree001a666bf845e51d63e1e73c52cecbc8f7b304d6 /drivers/media/rc
parent44fd0b600fbc21de9d771f0a5db79d24b321fce7 (diff)
[media] ati_remote: fix check for a weird byte
The ati_remote_dump() function tries to not print "Weird byte" warning for 1-byte responses that contain 0xff or 0x00, but it doesn't work properly as it simply falls back to the "Weird data" warning in the else clause. Fix that by adding an inner if clause. Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/ati_remote.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 7a47d7e73b57..92f2b1bcef4a 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -273,9 +273,10 @@ static struct usb_driver ati_remote_driver = {
273static void ati_remote_dump(struct device *dev, unsigned char *data, 273static void ati_remote_dump(struct device *dev, unsigned char *data,
274 unsigned int len) 274 unsigned int len)
275{ 275{
276 if ((len == 1) && (data[0] != (unsigned char)0xff) && (data[0] != 0x00)) 276 if (len == 1) {
277 dev_warn(dev, "Weird byte 0x%02x\n", data[0]); 277 if (data[0] != (unsigned char)0xff && data[0] != 0x00)
278 else if (len == 4) 278 dev_warn(dev, "Weird byte 0x%02x\n", data[0]);
279 } else if (len == 4)
279 dev_warn(dev, "Weird key %02x %02x %02x %02x\n", 280 dev_warn(dev, "Weird key %02x %02x %02x %02x\n",
280 data[0], data[1], data[2], data[3]); 281 data[0], data[1], data[2], data[3]);
281 else 282 else