summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-02-26 16:00:20 -0600
committerMike Isely <isely@pobox.com>2006-02-26 16:00:20 -0600
commit555a4680960f6297f0e4cdead5f8a48e3e3b9cfe (patch)
tree52c9475b64e5b42c8e47f481590b6eaa6e434305 /linux/drivers/media
parent70d1bdb4e801ae6b0c29d2f103225c966b9eded4 (diff)
downloadmediapointer-dvb-s2-555a4680960f6297f0e4cdead5f8a48e3e3b9cfe.tar.gz
mediapointer-dvb-s2-555a4680960f6297f0e4cdead5f8a48e3e3b9cfe.tar.bz2
Log a message if a pvrusb2 I2C write is too large
From: Mike Isely <isely@pobox.com> 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 <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c9
1 files changed, 8 insertions, 1 deletions
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);