[media] af9015: correct few error codes
authorAntti Palosaari <crope@iki.fi>
Wed, 12 Sep 2012 23:23:52 +0000 (20:23 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 23 Sep 2012 23:48:58 +0000 (20:48 -0300)
Plain '-1' is not very good error code. Use more suitable error
code definitions.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/dvb-usb-v2/af9015.c

index a4be303edb4f6b0f69f78dcf4a238ad1261b9b0f..824f1911ee21bcdcf3282ef33ffece13a1f3b654 100644 (file)
@@ -71,7 +71,7 @@ static int af9015_ctrl_msg(struct dvb_usb_device *d, struct req_t *req)
        default:
                dev_err(&d->udev->dev, "%s: unknown command=%d\n",
                                KBUILD_MODNAME, req->cmd);
-               ret = -1;
+               ret = -EIO;
                goto error;
        }
 
@@ -107,7 +107,7 @@ static int af9015_ctrl_msg(struct dvb_usb_device *d, struct req_t *req)
        if (rlen && buf[1]) {
                dev_err(&d->udev->dev, "%s: command failed=%d\n",
                                KBUILD_MODNAME, buf[1]);
-               ret = -1;
+               ret = -EIO;
                goto error;
        }
 
@@ -791,11 +791,11 @@ static int af9015_copy_firmware(struct dvb_usb_device *d)
        if (val == 0x04) {
                dev_err(&d->udev->dev, "%s: firmware did not run\n",
                                KBUILD_MODNAME);
-               ret = -1;
+               ret = -ETIMEDOUT;
        } else if (val != 0x0c) {
                dev_err(&d->udev->dev, "%s: firmware boot timeout\n",
                                KBUILD_MODNAME);
-               ret = -1;
+               ret = -ETIMEDOUT;
        }
 
 error: