diff options
author | Daniel Mack <daniel@caiaq.de> | 2010-07-01 01:08:58 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 15:01:15 -0300 |
commit | 8871c85d86829a2739ec797c4343ebd3664895b9 (patch) | |
tree | 8c9d492d0cdee152afc27d0f5e2f30bcd756386e /drivers/media/dvb/dvb-usb/dib0700_core.c | |
parent | 4c61f678a468768afd45c3d9ac697f8f55aa04eb (diff) | |
download | linux-8871c85d86829a2739ec797c4343ebd3664895b9.tar.bz2 |
V4L/DVB: drivers/media/dvb/dvb-usb/dib0700: fix return values
Propagte correct error values instead of returning -1 which just means
-EPERM ("Permission denied")
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dib0700_core.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dib0700_core.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c index 4f961d2d1817..d2dabac9b63a 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_core.c +++ b/drivers/media/dvb/dvb-usb/dib0700_core.c @@ -640,10 +640,10 @@ int dib0700_rc_setup(struct dvb_usb_device *d) return 0; /* Set the IR mode */ - i = dib0700_ctrl_wr(d, rc_setup, 3); - if (i<0) { + i = dib0700_ctrl_wr(d, rc_setup, sizeof(rc_setup)); + if (i < 0) { err("ir protocol setup failed"); - return -1; + return i; } if (st->fw_version < 0x10200) @@ -653,14 +653,14 @@ int dib0700_rc_setup(struct dvb_usb_device *d) purb = usb_alloc_urb(0, GFP_KERNEL); if (purb == NULL) { err("rc usb alloc urb failed\n"); - return -1; + return -ENOMEM; } purb->transfer_buffer = kzalloc(RC_MSG_SIZE_V1_20, GFP_KERNEL); if (purb->transfer_buffer == NULL) { err("rc kzalloc failed\n"); usb_free_urb(purb); - return -1; + return -ENOMEM; } purb->status = -EINPROGRESS; @@ -669,12 +669,10 @@ int dib0700_rc_setup(struct dvb_usb_device *d) dib0700_rc_urb_completion, d); ret = usb_submit_urb(purb, GFP_ATOMIC); - if (ret != 0) { + if (ret) err("rc submit urb failed\n"); - return -1; - } - return 0; + return ret; } static int dib0700_probe(struct usb_interface *intf, |