Skip to content

Commit

Permalink
[media] rtl28xxu: do not return error for unimplemented fe callback
Browse files Browse the repository at this point in the history
Use of frontend callback is highly hardware design dependent
and whole callback could be optional in many cases. Returning
error by default when callback is not implemented is stupid.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Sep 27, 2012
1 parent 4005c1a commit 97efe78
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/media/usb/dvb-usb-v2/rtl28xxu.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ static int rtl2832u_fc0012_tuner_callback(struct dvb_usb_device *d,
goto err;
}
return 0;

err:
dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
Expand Down Expand Up @@ -643,7 +642,6 @@ static int rtl2832u_tua9001_tuner_callback(struct dvb_usb_device *d,
}

return 0;

err:
dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
Expand All @@ -656,17 +654,15 @@ static int rtl2832u_tuner_callback(struct dvb_usb_device *d, int cmd, int arg)
switch (priv->tuner) {
case TUNER_RTL2832_FC0012:
return rtl2832u_fc0012_tuner_callback(d, cmd, arg);

case TUNER_RTL2832_FC0013:
return rtl2832u_fc0013_tuner_callback(d, cmd, arg);

case TUNER_RTL2832_TUA9001:
return rtl2832u_tua9001_tuner_callback(d, cmd, arg);
default:
break;
}

return -ENODEV;
return 0;
}

static int rtl2832u_frontend_callback(void *adapter_priv, int component,
Expand All @@ -682,7 +678,7 @@ static int rtl2832u_frontend_callback(void *adapter_priv, int component,
break;
}

return -EINVAL;
return 0;
}

static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
Expand Down

0 comments on commit 97efe78

Please sign in to comment.