Improve error handling for msp3400.c

From: Jan Dittmer (j.dittmer@portrix.net)
Date: Sat Jul 12 2003 - 16:47:03 EST


Hi,

on read/send failure the msp3400 driver is trying three times to recover and
is printing a message each time. On a unloaded system this happens at a rate
of about 1/min while watching tv and is quite annoying, while non critical.
This patchs gets rid of it and instead raises the final error message to
KERN_ERR if indeed the communication failed three times in a row.

Thanks,

Jan

-- 
Linux rubicon 2.5.75-mm1-jd10 #1 SMP Sat Jul 12 19:40:28 CEST 2003 i686

--- linux-bk/drivers/media/video/msp3400.c Fri May 30 20:29:35 2003 +++ 2.5.75-bk1-jd2/drivers/media/video/msp3400.c Sat Jul 12 23:41:19 2003 @@ -192,13 +192,11 @@ if (2 == i2c_transfer(client->adapter,msgs,2)) break; err++; - printk(KERN_WARNING "msp34xx: I/O error #%d (read 0x%02x/0x%02x)\n", - err, dev, addr); current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ/10); } if (3 == err) { - printk(KERN_WARNING "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); + printk(KERN_ERR "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); msp3400c_reset(client); return -1; } @@ -221,13 +219,11 @@ if (5 == i2c_master_send(client, buffer, 5)) break; err++; - printk(KERN_WARNING "msp34xx: I/O error #%d (write 0x%02x/0x%02x)\n", - err, dev, addr); current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ/10); } if (3 == err) { - printk(KERN_WARNING "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); + printk(KERN_ERR "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); msp3400c_reset(client); return -1; }

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:00:46 EST