From 555a4680960f6297f0e4cdead5f8a48e3e3b9cfe Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Sun, 26 Feb 2006 16:00:20 -0600 Subject: Log a message if a pvrusb2 I2C write is too large From: Mike Isely The wire protocol to the PVR USB2 hardware limits the total size of an I2C write transfer (among other things). The driver detects this case and fails the transfer; this change also logs the message. We need this in order to catch V4L modules which might be attempting such transfers and deal with them on a case-by-case basis. Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'linux/drivers/media/video/pvrusb2') diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index e682538ef..d3b223d09 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -51,7 +51,14 @@ static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ #endif if (!data) length = 0; - if (length > (sizeof(hdw->cmd_buffer) - 3)) return -ENOTSUPP; + if (length > (sizeof(hdw->cmd_buffer) - 3)) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Killing an I2C write to %u that is too large" + " (desired=%u limit=%u)", + i2c_addr, + length,(sizeof(hdw->cmd_buffer) - 3)); + return -ENOTSUPP; + } LOCK_TAKE(hdw->ctl_lock); -- cgit v1.2.3