summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-06-19 20:03:02 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-04 07:56:37 -0300
commit5cd983200ae8cba06d6ff5f515f741a654b62cf1 (patch)
tree5187a7eb3c596b2991bbc2f788cb8090fc192af5 /drivers/media/dvb/dvb-usb
parenta0921af7eb2eced1639fc1e1befdf703e7bec95a (diff)
downloadblackbird-op-linux-5cd983200ae8cba06d6ff5f515f741a654b62cf1.tar.gz
blackbird-op-linux-5cd983200ae8cba06d6ff5f515f741a654b62cf1.zip
[media] dvb_usb_v2: remove num_adapters_initialized variable
We can live easily without it so remove it, make code and binary few bytes smaller. >From struct dvb_usb_device variable int num_adapters_initialized. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb.h1
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb_init.c14
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h
index aecba307105e..2bef8f4ab71a 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb_usb.h
@@ -360,7 +360,6 @@ struct dvb_usb_device {
struct mutex i2c_mutex;
struct i2c_adapter i2c_adap;
- int num_adapters_initialized;
struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
/* remote control */
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_init.c b/drivers/media/dvb/dvb-usb/dvb_usb_init.c
index 24e1f2970d8e..1d92d831ab27 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb_init.c
+++ b/drivers/media/dvb/dvb-usb/dvb_usb_init.c
@@ -270,8 +270,6 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
adap->dvb_adap.mfe_shared = 1;
adap->dvb_adap.fe_ioctl_override = d->props->fe_ioctl_override;
-
- d->num_adapters_initialized++;
}
return 0;
@@ -292,8 +290,6 @@ static int dvb_usbv2_adapter_exit(struct dvb_usb_device *d)
dvb_usbv2_adapter_stream_exit(&d->adapter[i]);
}
- d->num_adapters_initialized = 0;
-
return 0;
}
@@ -551,8 +547,9 @@ int dvb_usbv2_suspend(struct usb_interface *intf, pm_message_t msg)
cancel_delayed_work_sync(&d->rc_query_work);
/* stop streaming */
- for (i = d->num_adapters_initialized - 1; i >= 0; i--) {
- if (d->adapter[i].active_fe != -1)
+ for (i = MAX_NO_OF_ADAPTER_PER_DEVICE - 1; i >= 0; i--) {
+ if (d->adapter[i].dvb_adap.priv &&
+ d->adapter[i].active_fe != -1)
usb_urb_killv2(&d->adapter[i].stream);
}
@@ -568,8 +565,9 @@ int dvb_usbv2_resume(struct usb_interface *intf)
pr_debug("%s:\n", __func__);
/* start streaming */
- for (i = 0; i < d->num_adapters_initialized; i++) {
- if (d->adapter[i].active_fe != -1)
+ for (i = 0; i < MAX_NO_OF_ADAPTER_PER_DEVICE; i++) {
+ if (d->adapter[i].dvb_adap.priv &&
+ d->adapter[i].active_fe != -1)
usb_urb_submitv2(&d->adapter[i].stream, NULL);
}
OpenPOWER on IntegriCloud