[media] dvb_usb_v2: remove various unneeded variables
Adapter priv is not really needed, use device priv instead. There is only driver or two using that. Device caps are not needed. There was only "has I2C adapter" capability defined. It is useless as we can see same just checking existence of i2c_algo callback. And also remove some totally not used at all variables. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
19ec2728d7
commit
e80e9af308
|
@ -211,9 +211,6 @@ struct dvb_usb_device_properties {
|
||||||
struct module *owner;
|
struct module *owner;
|
||||||
short *adapter_nr;
|
short *adapter_nr;
|
||||||
|
|
||||||
#define DVB_USB_IS_AN_I2C_ADAPTER 0x01
|
|
||||||
int caps;
|
|
||||||
|
|
||||||
int size_of_priv;
|
int size_of_priv;
|
||||||
|
|
||||||
const char *firmware;
|
const char *firmware;
|
||||||
|
@ -330,8 +327,6 @@ struct dvb_usb_adapter {
|
||||||
|
|
||||||
int active_fe;
|
int active_fe;
|
||||||
int num_frontends_initialized;
|
int num_frontends_initialized;
|
||||||
|
|
||||||
void *priv;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -379,7 +374,7 @@ struct dvb_usb_device {
|
||||||
struct mutex i2c_mutex;
|
struct mutex i2c_mutex;
|
||||||
struct i2c_adapter i2c_adap;
|
struct i2c_adapter i2c_adap;
|
||||||
|
|
||||||
int num_adapters_initialized;
|
int num_adapters_initialized;
|
||||||
struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
|
struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
|
||||||
|
|
||||||
/* remote control */
|
/* remote control */
|
||||||
|
@ -387,8 +382,6 @@ struct dvb_usb_device {
|
||||||
struct input_dev *input_dev;
|
struct input_dev *input_dev;
|
||||||
char rc_phys[64];
|
char rc_phys[64];
|
||||||
struct delayed_work rc_query_work;
|
struct delayed_work rc_query_work;
|
||||||
u32 last_event;
|
|
||||||
int last_state;
|
|
||||||
|
|
||||||
void *priv;
|
void *priv;
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,14 +11,9 @@ int dvb_usb_i2c_init(struct dvb_usb_device *d)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!(d->props.caps & DVB_USB_IS_AN_I2C_ADAPTER))
|
if (!d->props.i2c_algo)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (d->props.i2c_algo == NULL) {
|
|
||||||
err("no i2c algorithm specified");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
strlcpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name));
|
strlcpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name));
|
||||||
d->i2c_adap.algo = d->props.i2c_algo;
|
d->i2c_adap.algo = d->props.i2c_algo;
|
||||||
d->i2c_adap.algo_data = NULL;
|
d->i2c_adap.algo_data = NULL;
|
||||||
|
|
|
@ -125,14 +125,6 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d)
|
||||||
adap->max_feed_count = adap->props.pid_filter_count;
|
adap->max_feed_count = adap->props.pid_filter_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adap->props.size_of_priv > 0) {
|
|
||||||
adap->priv = kzalloc(adap->props.size_of_priv, GFP_KERNEL);
|
|
||||||
if (adap->priv == NULL) {
|
|
||||||
err("no memory for priv for adapter %d.", n);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = dvb_usb_adapter_stream_init(adap);
|
ret = dvb_usb_adapter_stream_init(adap);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -178,7 +170,7 @@ static int dvb_usb_adapter_exit(struct dvb_usb_device *d)
|
||||||
dvb_usb_adapter_frontend_exit(&d->adapter[n]);
|
dvb_usb_adapter_frontend_exit(&d->adapter[n]);
|
||||||
dvb_usb_adapter_dvb_exit(&d->adapter[n]);
|
dvb_usb_adapter_dvb_exit(&d->adapter[n]);
|
||||||
dvb_usb_adapter_stream_exit(&d->adapter[n]);
|
dvb_usb_adapter_stream_exit(&d->adapter[n]);
|
||||||
kfree(d->adapter[n].priv);
|
|
||||||
}
|
}
|
||||||
d->num_adapters_initialized = 0;
|
d->num_adapters_initialized = 0;
|
||||||
d->state &= ~DVB_USB_STATE_DVB;
|
d->state &= ~DVB_USB_STATE_DVB;
|
||||||
|
|
Loading…
Reference in New Issue