summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-12-17 03:09:32 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-03 16:21:19 -0200
commita6f62431a0c166c171b6b7a62d6cad79fbbdc5da (patch)
tree8e414feea2fe9911d621ae117d33ca53cc9283f2 /drivers/media
parent1dbbdceeb63e9039ce0545e5e21cf9a8c4d4ffc4 (diff)
downloadblackbird-op-linux-a6f62431a0c166c171b6b7a62d6cad79fbbdc5da.tar.gz
blackbird-op-linux-a6f62431a0c166c171b6b7a62d6cad79fbbdc5da.zip
[media] rtl28xxu: simplify FE callback handling
Logic is so simple that there is no idea to separate tuner selection to own function, instead do it in a callback and get rid of one function. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/dvb-usb-v2/rtl28xxu.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 1f29307b9d72..f4750189e948 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -721,22 +721,6 @@ err:
return ret;
}
-static int rtl2832u_tuner_callback(struct dvb_usb_device *d, int cmd, int arg)
-{
- struct rtl28xxu_priv *priv = d->priv;
-
- switch (priv->tuner) {
- case TUNER_RTL2832_FC0012:
- return rtl2832u_fc0012_tuner_callback(d, cmd, arg);
- case TUNER_RTL2832_TUA9001:
- return rtl2832u_tua9001_tuner_callback(d, cmd, arg);
- default:
- break;
- }
-
- return 0;
-}
-
static int rtl2832u_frontend_callback(void *adapter_priv, int component,
int cmd, int arg)
{
@@ -744,6 +728,7 @@ static int rtl2832u_frontend_callback(void *adapter_priv, int component,
struct device *parent = adapter->dev.parent;
struct i2c_adapter *parent_adapter;
struct dvb_usb_device *d;
+ struct rtl28xxu_priv *priv;
/*
* All tuners are connected to demod muxed I2C adapter. We have to
@@ -757,15 +742,21 @@ static int rtl2832u_frontend_callback(void *adapter_priv, int component,
return -EINVAL;
d = i2c_get_adapdata(parent_adapter);
+ priv = d->priv;
dev_dbg(&d->udev->dev, "%s: component=%d cmd=%d arg=%d\n",
__func__, component, cmd, arg);
switch (component) {
case DVB_FRONTEND_COMPONENT_TUNER:
- return rtl2832u_tuner_callback(d, cmd, arg);
+ switch (priv->tuner) {
+ case TUNER_RTL2832_FC0012:
+ return rtl2832u_fc0012_tuner_callback(d, cmd, arg);
+ case TUNER_RTL2832_TUA9001:
+ return rtl2832u_tua9001_tuner_callback(d, cmd, arg);
+ }
default:
- break;
+ return -EINVAL;
}
return 0;
OpenPOWER on IntegriCloud