[media] dvb: get rid of fe_ioctl_override callback
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 5 Aug 2012 17:16:30 +0000 (14:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 13 Aug 2012 19:34:03 +0000 (16:34 -0300)
This callback were meant to allow overriding a FE callback, before its
call, but it is not really needed, as the callback can be intercepted
after tuner attachment.

Worse than that, only DVBv3 calls are intercepted this way, so a DVBv5
application will produce different effects than a DVBv3 one.

So, get rid of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
12 files changed:
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/dvb/dvb-core/dvbdev.h
drivers/media/dvb/dvb-usb-v2/dvb_usb.h
drivers/media/dvb/dvb-usb-v2/dvb_usb_core.c
drivers/media/dvb/dvb-usb-v2/mxl111sf.c
drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
drivers/media/dvb/dvb-usb/dvb-usb.h
drivers/media/video/cx23885/cx23885-dvb.c
drivers/media/video/cx88/cx88-dvb.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/videobuf-dvb.c
include/media/videobuf-dvb.h

index 3a0f245471965055a5c903ee7b81c9c32bedf055..12e5eb1fff765b1bea541caa3065aa81d2710b9b 100644 (file)
@@ -2060,18 +2060,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
        struct dvb_frontend *fe = dvbdev->priv;
        struct dvb_frontend_private *fepriv = fe->frontend_priv;
        struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-       int cb_err, err = -EOPNOTSUPP;
-
-       if (fe->dvb->fe_ioctl_override) {
-               cb_err = fe->dvb->fe_ioctl_override(fe, cmd, parg,
-                                                   DVB_FE_IOCTL_PRE);
-               if (cb_err < 0)
-                       return cb_err;
-               if (cb_err > 0)
-                       return 0;
-               /* fe_ioctl_override returning 0 allows
-                * dvb-core to continue handling the ioctl */
-       }
+       int err = -EOPNOTSUPP;
 
        switch (cmd) {
        case FE_GET_INFO: {
index 3b2c137b182c43b7ea824e8a19497e3eb1d1b954..93a9470d3f0c7c19d3d9391bdc37a27ac66a7e6e 100644 (file)
@@ -71,27 +71,6 @@ struct dvb_adapter {
        int mfe_shared;                 /* indicates mutually exclusive frontends */
        struct dvb_device *mfe_dvbdev;  /* frontend device in use */
        struct mutex mfe_lock;          /* access lock for thread creation */
-
-       /* Allow the adapter/bridge driver to perform an action before and/or
-        * after the core handles an ioctl:
-        *
-        * DVB_FE_IOCTL_PRE indicates that the ioctl has not yet been handled.
-        *
-        * When DVB_FE_IOCTL_PRE is passed to the callback as the stage arg:
-        *
-        * return 0 to allow dvb-core to handle the ioctl.
-        * return a positive int to prevent dvb-core from handling the ioctl,
-        *      and exit without error.
-        * return a negative int to prevent dvb-core from handling the ioctl,
-        *      and return that value as an error.
-        *
-        * WARNING: Don't use it on newer drivers: this only affects DVBv3
-        * calls, and should be removed soon.
-        */
-#define DVB_FE_IOCTL_PRE 0
-       int (*fe_ioctl_override)(struct dvb_frontend *fe,
-                                unsigned int cmd, void *parg,
-                                unsigned int stage);
 };
 
 
index 773817b5fe0669946e8324374669c29904cb6064..79b3b8b6750d337d37ae8dd44baf7b01464b656f 100644 (file)
@@ -206,7 +206,6 @@ struct dvb_usb_adapter_properties {
  * @tuner_attach: called to attach the possible tuners
  * @frontend_ctrl: called to power on/off active frontend
  * @streaming_ctrl: called to start/stop the usb streaming of adapter
- * @fe_ioctl_override: frontend ioctl override. avoid using that is possible
  * @init: called after adapters are created in order to finalize device
  *  configuration
  * @exit: called when driver is unloaded
@@ -247,8 +246,6 @@ struct dvb_usb_device_properties {
        int (*tuner_attach) (struct dvb_usb_adapter *);
        int (*frontend_ctrl) (struct dvb_frontend *, int);
        int (*streaming_ctrl) (struct dvb_frontend *, int);
-       int (*fe_ioctl_override) (struct dvb_frontend *,
-                       unsigned int, void *, unsigned int);
        int (*init) (struct dvb_usb_device *);
        void (*exit) (struct dvb_usb_device *);
        int (*get_rc_config) (struct dvb_usb_device *, struct dvb_usb_rc *);
index 3224621e1f323c2f23457385a77e3eeef86e7fc2..a72f9c7de682e9cbfa8ccdf710bd88764fa910ba 100644 (file)
@@ -703,8 +703,6 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
                /* use exclusive FE lock if there is multiple shared FEs */
                if (adap->fe[1])
                        adap->dvb_adap.mfe_shared = 1;
-
-               adap->dvb_adap.fe_ioctl_override = d->props->fe_ioctl_override;
        }
 
        return 0;
index 861e0ae2abc53014f5311aefe145e6a2502adcea..efdcb15358f118ae3ebd0aae1aeb732ceecf1de3 100644 (file)
@@ -874,34 +874,12 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap)
                if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state,
                                &mxl_tuner_config) == NULL)
                        return -EIO;
+               adap->fe[i]->ops.read_signal_strength = adap->fe[i]->ops.tuner_ops.get_rf_strength;
        }
 
        return 0;
 }
 
-static int mxl111sf_fe_ioctl_override(struct dvb_frontend *fe,
-                                     unsigned int cmd, void *parg,
-                                     unsigned int stage)
-{
-       int err = 0;
-
-       switch (stage) {
-       case DVB_FE_IOCTL_PRE:
-
-               switch (cmd) {
-               case FE_READ_SIGNAL_STRENGTH:
-                       err = fe->ops.tuner_ops.get_rf_strength(fe, parg);
-                       /* If no error occurs, prevent dvb-core from handling
-                        * this IOCTL, otherwise return the error */
-                       if (0 == err)
-                               err = 1;
-                       break;
-               }
-               break;
-       }
-       return err;
-};
-
 static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter)
 {
        return I2C_FUNC_I2C;
@@ -1082,7 +1060,6 @@ static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
        .init              = mxl111sf_init,
        .streaming_ctrl    = mxl111sf_ep4_streaming_ctrl,
        .get_stream_config = mxl111sf_get_stream_config_dvbt,
-       .fe_ioctl_override = mxl111sf_fe_ioctl_override,
 
        .num_adapters = 1,
        .adapter = {
@@ -1124,7 +1101,6 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc = {
        .init              = mxl111sf_init,
        .streaming_ctrl    = mxl111sf_ep6_streaming_ctrl,
        .get_stream_config = mxl111sf_get_stream_config_atsc,
-       .fe_ioctl_override = mxl111sf_fe_ioctl_override,
 
        .num_adapters = 1,
        .adapter = {
@@ -1166,7 +1142,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mh = {
        .init              = mxl111sf_init,
        .streaming_ctrl    = mxl111sf_ep5_streaming_ctrl,
        .get_stream_config = mxl111sf_get_stream_config_mh,
-       .fe_ioctl_override = mxl111sf_fe_ioctl_override,
 
        .num_adapters = 1,
        .adapter = {
@@ -1235,7 +1210,6 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = {
        .init              = mxl111sf_init,
        .streaming_ctrl    = mxl111sf_streaming_ctrl_atsc_mh,
        .get_stream_config = mxl111sf_get_stream_config_atsc_mh,
-       .fe_ioctl_override = mxl111sf_fe_ioctl_override,
 
        .num_adapters = 1,
        .adapter = {
@@ -1314,7 +1288,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury = {
        .init              = mxl111sf_init,
        .streaming_ctrl    = mxl111sf_streaming_ctrl_mercury,
        .get_stream_config = mxl111sf_get_stream_config_mercury,
-       .fe_ioctl_override = mxl111sf_fe_ioctl_override,
 
        .num_adapters = 1,
        .adapter = {
@@ -1385,7 +1358,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = {
        .init              = mxl111sf_init,
        .streaming_ctrl    = mxl111sf_streaming_ctrl_mercury_mh,
        .get_stream_config = mxl111sf_get_stream_config_mercury_mh,
-       .fe_ioctl_override = mxl111sf_fe_ioctl_override,
 
        .num_adapters = 1,
        .adapter = {
index ddf282f355b3c78f9f71608f4f445f196d68d3fc..719413b15f208b7ceb165422ff4d1111dfcfd6e1 100644 (file)
@@ -106,7 +106,6 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
                goto err;
        }
        adap->dvb_adap.priv = adap;
-       adap->dvb_adap.fe_ioctl_override = adap->props.fe_ioctl_override;
 
        if (adap->dev->props.read_mac_address) {
                if (adap->dev->props.read_mac_address(adap->dev,adap->dvb_adap.proposed_mac) == 0)
index 99f94409efa1768ebf1d20590dcaf633fda1a414..aab0f99bc892bc764530e9966b87561eede5974f 100644 (file)
@@ -162,8 +162,6 @@ struct dvb_usb_adapter_properties {
        int size_of_priv;
 
        int (*frontend_ctrl)   (struct dvb_frontend *, int);
-       int (*fe_ioctl_override) (struct dvb_frontend *,
-                                 unsigned int, void *, unsigned int);
 
        int num_frontends;
        struct dvb_usb_adapter_fe_properties fe[MAX_NO_OF_FE_PER_ADAP];
index cd542684ba022c4f194928e37cfc318d6a1b0b79..f3202a52d5352e60deb08345f9f74562a1201bc6 100644 (file)
@@ -1218,8 +1218,7 @@ static int dvb_register(struct cx23885_tsport *port)
 
        /* register everything */
        ret = videobuf_dvb_register_bus(&port->frontends, THIS_MODULE, port,
-                                       &dev->pci->dev, adapter_nr, mfe_shared,
-                                       NULL);
+                                       &dev->pci->dev, adapter_nr, mfe_shared);
        if (ret)
                goto frontend_detach;
 
index 003937cd72f553e80bceecdcb9a0befe8986630a..d803bba09525206e9710d401829251d829e04ede 100644 (file)
@@ -1578,7 +1578,7 @@ static int dvb_register(struct cx8802_dev *dev)
 
        /* register everything */
        res = videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev,
-               &dev->pci->dev, adapter_nr, mfe_shared, NULL);
+               &dev->pci->dev, adapter_nr, mfe_shared);
        if (res)
                goto frontend_detach;
        return res;
index cc7f3d6ee966f955cbaac74dfa3670d453e7c963..d0f53bb153e3a09124ceb6965ebf01b11d3be96d 100644 (file)
@@ -1849,7 +1849,7 @@ static int dvb_init(struct saa7134_dev *dev)
 
        /* register everything else */
        ret = videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev,
-                                       &dev->pci->dev, adapter_nr, 0, NULL);
+                                       &dev->pci->dev, adapter_nr, 0);
 
        /* this sequence is necessary to make the tda1004x load its firmware
         * and to enter analog mode of hybrid boards
index 94d83a41381b4b4ac3200cce96da3e471cdbd56b..b7efa4516d367944e9f44c385c725f05280daf60 100644 (file)
@@ -139,9 +139,7 @@ static int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
                          struct device *device,
                          char *adapter_name,
                          short *adapter_nr,
-                         int mfe_shared,
-                         int (*fe_ioctl_override)(struct dvb_frontend *,
-                                       unsigned int, void *, unsigned int))
+                         int mfe_shared)
 {
        int result;
 
@@ -156,7 +154,6 @@ static int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
        }
        fe->adapter.priv = adapter_priv;
        fe->adapter.mfe_shared = mfe_shared;
-       fe->adapter.fe_ioctl_override = fe_ioctl_override;
 
        return result;
 }
@@ -257,9 +254,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
                          void *adapter_priv,
                          struct device *device,
                          short *adapter_nr,
-                         int mfe_shared,
-                         int (*fe_ioctl_override)(struct dvb_frontend *,
-                                       unsigned int, void *, unsigned int))
+                         int mfe_shared)
 {
        struct list_head *list, *q;
        struct videobuf_dvb_frontend *fe;
@@ -273,7 +268,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
 
        /* Bring up the adapter */
        res = videobuf_dvb_register_adapter(f, module, adapter_priv, device,
-               fe->dvb.name, adapter_nr, mfe_shared, fe_ioctl_override);
+               fe->dvb.name, adapter_nr, mfe_shared);
        if (res < 0) {
                printk(KERN_WARNING "videobuf_dvb_register_adapter failed (errno = %d)\n", res);
                return res;
index bf365721d6b05f180169bfb4030c05b2c0345cab..d63965a1faaf6984aa2d1dd2c42e6984586801e5 100644 (file)
@@ -45,9 +45,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
                          void *adapter_priv,
                          struct device *device,
                          short *adapter_nr,
-                         int mfe_shared,
-                         int (*fe_ioctl_override)(struct dvb_frontend *,
-                                       unsigned int, void *, unsigned int));
+                         int mfe_shared);
 
 void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);