Commit d25cb646 authored by Alexey Klimov's avatar Alexey Klimov Committed by Mauro Carvalho Chehab

V4L/DVB (10062): dsbr100: change return values in 3 functions

Patch replace return -1; with return retval; in 3 functions.
And we also change if-checks for this returned values.
Signed-off-by: default avatarAlexey Klimov <klimov.linux@gmail.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6076dbf4
...@@ -236,7 +236,7 @@ usb_control_msg_failed: ...@@ -236,7 +236,7 @@ usb_control_msg_failed:
dev_err(&radio->usbdev->dev, dev_err(&radio->usbdev->dev,
"%s - usb_control_msg returned %i, request %i\n", "%s - usb_control_msg returned %i, request %i\n",
__func__, retval, request); __func__, retval, request);
return -1; return retval;
} }
...@@ -279,7 +279,7 @@ usb_control_msg_failed: ...@@ -279,7 +279,7 @@ usb_control_msg_failed:
dev_err(&radio->usbdev->dev, dev_err(&radio->usbdev->dev,
"%s - usb_control_msg returned %i, request %i\n", "%s - usb_control_msg returned %i, request %i\n",
__func__, retval, request); __func__, retval, request);
return -1; return retval;
} }
...@@ -336,7 +336,7 @@ usb_control_msg_failed: ...@@ -336,7 +336,7 @@ usb_control_msg_failed:
dev_err(&radio->usbdev->dev, dev_err(&radio->usbdev->dev,
"%s - usb_control_msg returned %i, request %i\n", "%s - usb_control_msg returned %i, request %i\n",
__func__, retval, request); __func__, retval, request);
return -1; return retval;
} }
/* return the device status. This is, in effect, just whether it /* return the device status. This is, in effect, just whether it
...@@ -452,7 +452,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, ...@@ -452,7 +452,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
radio->curfreq = f->frequency; radio->curfreq = f->frequency;
retval = dsbr100_setfreq(radio, radio->curfreq); retval = dsbr100_setfreq(radio, radio->curfreq);
if (retval == -1) if (retval < 0)
dev_warn(&radio->usbdev->dev, "Set frequency failed\n"); dev_warn(&radio->usbdev->dev, "Set frequency failed\n");
return 0; return 0;
} }
...@@ -516,14 +516,14 @@ static int vidioc_s_ctrl(struct file *file, void *priv, ...@@ -516,14 +516,14 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
case V4L2_CID_AUDIO_MUTE: case V4L2_CID_AUDIO_MUTE:
if (ctrl->value) { if (ctrl->value) {
retval = dsbr100_stop(radio); retval = dsbr100_stop(radio);
if (retval == -1) { if (retval < 0) {
dev_warn(&radio->usbdev->dev, dev_warn(&radio->usbdev->dev,
"Radio did not respond properly\n"); "Radio did not respond properly\n");
return -EBUSY; return -EBUSY;
} }
} else { } else {
retval = dsbr100_start(radio); retval = dsbr100_start(radio);
if (retval == -1) { if (retval < 0) {
dev_warn(&radio->usbdev->dev, dev_warn(&radio->usbdev->dev,
"Radio did not respond properly\n"); "Radio did not respond properly\n");
return -EBUSY; return -EBUSY;
...@@ -585,7 +585,7 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file) ...@@ -585,7 +585,7 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file)
} }
retval = dsbr100_setfreq(radio, radio->curfreq); retval = dsbr100_setfreq(radio, radio->curfreq);
if (retval == -1) if (retval < 0)
dev_warn(&radio->usbdev->dev, dev_warn(&radio->usbdev->dev,
"set frequency failed\n"); "set frequency failed\n");
...@@ -604,7 +604,7 @@ static int usb_dsbr100_close(struct inode *inode, struct file *file) ...@@ -604,7 +604,7 @@ static int usb_dsbr100_close(struct inode *inode, struct file *file)
radio->users = 0; radio->users = 0;
if (!radio->removed) { if (!radio->removed) {
retval = dsbr100_stop(radio); retval = dsbr100_stop(radio);
if (retval == -1) { if (retval < 0) {
dev_warn(&radio->usbdev->dev, dev_warn(&radio->usbdev->dev,
"dsbr100_stop failed\n"); "dsbr100_stop failed\n");
} }
...@@ -620,7 +620,7 @@ static int usb_dsbr100_suspend(struct usb_interface *intf, pm_message_t message) ...@@ -620,7 +620,7 @@ static int usb_dsbr100_suspend(struct usb_interface *intf, pm_message_t message)
int retval; int retval;
retval = dsbr100_stop(radio); retval = dsbr100_stop(radio);
if (retval == -1) if (retval < 0)
dev_warn(&intf->dev, "dsbr100_stop failed\n"); dev_warn(&intf->dev, "dsbr100_stop failed\n");
dev_info(&intf->dev, "going into suspend..\n"); dev_info(&intf->dev, "going into suspend..\n");
...@@ -635,7 +635,7 @@ static int usb_dsbr100_resume(struct usb_interface *intf) ...@@ -635,7 +635,7 @@ static int usb_dsbr100_resume(struct usb_interface *intf)
int retval; int retval;
retval = dsbr100_start(radio); retval = dsbr100_start(radio);
if (retval == -1) if (retval < 0)
dev_warn(&intf->dev, "dsbr100_start failed\n"); dev_warn(&intf->dev, "dsbr100_start failed\n");
dev_info(&intf->dev, "coming out of suspend..\n"); dev_info(&intf->dev, "coming out of suspend..\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment