aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/firewire/firedtv-avc.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2011-07-06 14:54:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:38 -0400
commit686a9488cd23cce1fa8a6cddde0e7668ae2e74b4 (patch)
tree68690c3a2dc4204ed9a139e7ce2821d7bc524c3f /drivers/media/dvb/firewire/firedtv-avc.c
parent7a286cc1889f14c5c8dbf866718edde100527d8c (diff)
[media] firedtv: change some -EFAULT returns to more fitting error codes
Mauro Carvalho Chehab wrote: > I'm validating if all drivers are behaving equally with respect to the > error codes returned to userspace, and double-checking with the API. > > On almost all places, -EFAULT code is used only to indicate when > copy_from_user/copy_to_user fails. However, firedtv uses a lot of > -EFAULT, where it seems to me that other error codes should be used > instead (like -EIO for bus transfer errors and -EINVAL/-ERANGE for > invalid/out of range parameters). This concerns only the CI (CAM) related code of firedtv of which I know little. Let's just pass through the error returns of lower level I/O code where applicable, and -EACCES (permission denied) when a seemingly valid but negative FCP response or an unknown-to-firedtv CA message is received. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Henrik Kurelid <henrik@kurelid.se> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/firewire/firedtv-avc.c')
-rw-r--r--drivers/media/dvb/firewire/firedtv-avc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb/firewire/firedtv-avc.c b/drivers/media/dvb/firewire/firedtv-avc.c
index 21c52e3b522e..489ae8245867 100644
--- a/drivers/media/dvb/firewire/firedtv-avc.c
+++ b/drivers/media/dvb/firewire/firedtv-avc.c
@@ -1208,7 +1208,7 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
1208 if (r->response != AVC_RESPONSE_ACCEPTED) { 1208 if (r->response != AVC_RESPONSE_ACCEPTED) {
1209 dev_err(fdtv->device, 1209 dev_err(fdtv->device,
1210 "CA PMT failed with response 0x%x\n", r->response); 1210 "CA PMT failed with response 0x%x\n", r->response);
1211 ret = -EFAULT; 1211 ret = -EACCES;
1212 } 1212 }
1213out: 1213out:
1214 mutex_unlock(&fdtv->avc_mutex); 1214 mutex_unlock(&fdtv->avc_mutex);