Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9adf6132 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] dvb: get rid of fe_ioctl_override callback



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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: default avatarAntti Palosaari <crope@iki.fi>
Reviewed-by: default avatarAntti Palosaari <crope@iki.fi>
parent 727b81da
Loading
Loading
Loading
Loading
+1 −12
Original line number Original line Diff line number Diff line
@@ -2060,18 +2060,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
	struct dvb_frontend *fe = dvbdev->priv;
	struct dvb_frontend *fe = dvbdev->priv;
	struct dvb_frontend_private *fepriv = fe->frontend_priv;
	struct dvb_frontend_private *fepriv = fe->frontend_priv;
	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
	int cb_err, err = -EOPNOTSUPP;
	int 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 */
	}


	switch (cmd) {
	switch (cmd) {
	case FE_GET_INFO: {
	case FE_GET_INFO: {
+0 −21
Original line number Original line Diff line number Diff line
@@ -71,27 +71,6 @@ struct dvb_adapter {
	int mfe_shared;			/* indicates mutually exclusive frontends */
	int mfe_shared;			/* indicates mutually exclusive frontends */
	struct dvb_device *mfe_dvbdev;	/* frontend device in use */
	struct dvb_device *mfe_dvbdev;	/* frontend device in use */
	struct mutex mfe_lock;		/* access lock for thread creation */
	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);
};
};




+0 −3
Original line number Original line Diff line number Diff line
@@ -206,7 +206,6 @@ struct dvb_usb_adapter_properties {
 * @tuner_attach: called to attach the possible tuners
 * @tuner_attach: called to attach the possible tuners
 * @frontend_ctrl: called to power on/off active frontend
 * @frontend_ctrl: called to power on/off active frontend
 * @streaming_ctrl: called to start/stop the usb streaming of adapter
 * @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
 * @init: called after adapters are created in order to finalize device
 *  configuration
 *  configuration
 * @exit: called when driver is unloaded
 * @exit: called when driver is unloaded
@@ -247,8 +246,6 @@ struct dvb_usb_device_properties {
	int (*tuner_attach) (struct dvb_usb_adapter *);
	int (*tuner_attach) (struct dvb_usb_adapter *);
	int (*frontend_ctrl) (struct dvb_frontend *, int);
	int (*frontend_ctrl) (struct dvb_frontend *, int);
	int (*streaming_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 *);
	int (*init) (struct dvb_usb_device *);
	void (*exit) (struct dvb_usb_device *);
	void (*exit) (struct dvb_usb_device *);
	int (*get_rc_config) (struct dvb_usb_device *, struct dvb_usb_rc *);
	int (*get_rc_config) (struct dvb_usb_device *, struct dvb_usb_rc *);
+0 −2
Original line number Original line Diff line number Diff line
@@ -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 */
		/* use exclusive FE lock if there is multiple shared FEs */
		if (adap->fe[1])
		if (adap->fe[1])
			adap->dvb_adap.mfe_shared = 1;
			adap->dvb_adap.mfe_shared = 1;

		adap->dvb_adap.fe_ioctl_override = d->props->fe_ioctl_override;
	}
	}


	return 0;
	return 0;
+1 −29
Original line number Original line Diff line number Diff line
@@ -874,34 +874,12 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap)
		if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state,
		if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state,
				&mxl_tuner_config) == NULL)
				&mxl_tuner_config) == NULL)
			return -EIO;
			return -EIO;
		adap->fe[i]->ops.read_signal_strength = adap->fe[i]->ops.tuner_ops.get_rf_strength;
	}
	}


	return 0;
	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)
static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter)
{
{
	return I2C_FUNC_I2C;
	return I2C_FUNC_I2C;
@@ -1082,7 +1060,6 @@ static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
	.init              = mxl111sf_init,
	.init              = mxl111sf_init,
	.streaming_ctrl    = mxl111sf_ep4_streaming_ctrl,
	.streaming_ctrl    = mxl111sf_ep4_streaming_ctrl,
	.get_stream_config = mxl111sf_get_stream_config_dvbt,
	.get_stream_config = mxl111sf_get_stream_config_dvbt,
	.fe_ioctl_override = mxl111sf_fe_ioctl_override,


	.num_adapters = 1,
	.num_adapters = 1,
	.adapter = {
	.adapter = {
@@ -1124,7 +1101,6 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc = {
	.init              = mxl111sf_init,
	.init              = mxl111sf_init,
	.streaming_ctrl    = mxl111sf_ep6_streaming_ctrl,
	.streaming_ctrl    = mxl111sf_ep6_streaming_ctrl,
	.get_stream_config = mxl111sf_get_stream_config_atsc,
	.get_stream_config = mxl111sf_get_stream_config_atsc,
	.fe_ioctl_override = mxl111sf_fe_ioctl_override,


	.num_adapters = 1,
	.num_adapters = 1,
	.adapter = {
	.adapter = {
@@ -1166,7 +1142,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mh = {
	.init              = mxl111sf_init,
	.init              = mxl111sf_init,
	.streaming_ctrl    = mxl111sf_ep5_streaming_ctrl,
	.streaming_ctrl    = mxl111sf_ep5_streaming_ctrl,
	.get_stream_config = mxl111sf_get_stream_config_mh,
	.get_stream_config = mxl111sf_get_stream_config_mh,
	.fe_ioctl_override = mxl111sf_fe_ioctl_override,


	.num_adapters = 1,
	.num_adapters = 1,
	.adapter = {
	.adapter = {
@@ -1235,7 +1210,6 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = {
	.init              = mxl111sf_init,
	.init              = mxl111sf_init,
	.streaming_ctrl    = mxl111sf_streaming_ctrl_atsc_mh,
	.streaming_ctrl    = mxl111sf_streaming_ctrl_atsc_mh,
	.get_stream_config = mxl111sf_get_stream_config_atsc_mh,
	.get_stream_config = mxl111sf_get_stream_config_atsc_mh,
	.fe_ioctl_override = mxl111sf_fe_ioctl_override,


	.num_adapters = 1,
	.num_adapters = 1,
	.adapter = {
	.adapter = {
@@ -1314,7 +1288,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury = {
	.init              = mxl111sf_init,
	.init              = mxl111sf_init,
	.streaming_ctrl    = mxl111sf_streaming_ctrl_mercury,
	.streaming_ctrl    = mxl111sf_streaming_ctrl_mercury,
	.get_stream_config = mxl111sf_get_stream_config_mercury,
	.get_stream_config = mxl111sf_get_stream_config_mercury,
	.fe_ioctl_override = mxl111sf_fe_ioctl_override,


	.num_adapters = 1,
	.num_adapters = 1,
	.adapter = {
	.adapter = {
@@ -1385,7 +1358,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = {
	.init              = mxl111sf_init,
	.init              = mxl111sf_init,
	.streaming_ctrl    = mxl111sf_streaming_ctrl_mercury_mh,
	.streaming_ctrl    = mxl111sf_streaming_ctrl_mercury_mh,
	.get_stream_config = mxl111sf_get_stream_config_mercury_mh,
	.get_stream_config = mxl111sf_get_stream_config_mercury_mh,
	.fe_ioctl_override = mxl111sf_fe_ioctl_override,


	.num_adapters = 1,
	.num_adapters = 1,
	.adapter = {
	.adapter = {
Loading