[media] dvb_usb_v2: remove adapter_nums parameter from dvb_usbv2_device_init()
authorAntti Palosaari <crope@iki.fi>
Wed, 23 May 2012 19:23:44 +0000 (16:23 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 4 Aug 2012 10:56:20 +0000 (07:56 -0300)
Pass that parameter via configuration structure.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/dvb_usb.h
drivers/media/dvb/dvb-usb/dvb_usb_common.h
drivers/media/dvb/dvb-usb/dvb_usb_dvb.c
drivers/media/dvb/dvb-usb/dvb_usb_init.c

index db9a7ddd039d8b20063061d861d020461dc83cf1..101191e73661d91ffb75dc21b3025107907b0442 100644 (file)
@@ -265,6 +265,7 @@ enum dvb_usb_mode {
 #define MAX_NO_OF_ADAPTER_PER_DEVICE 2
 struct dvb_usb_device_properties {
        struct module *owner;
+       short *adapter_nr;
 
 #define DVB_USB_IS_AN_I2C_ADAPTER            0x01
        int caps;
@@ -460,8 +461,7 @@ struct dvb_usb_device {
 };
 
 extern int dvb_usbv2_device_init(struct usb_interface *,
-                               const struct usb_device_id *,
-                              short *adapter_nums);
+               const struct usb_device_id *);
 extern void dvb_usbv2_device_exit(struct usb_interface *);
 
 /* the generic read/write method for device control */
index 29df53999a9c6db6241aedfb67d5731e90fb5601..24341bde02d8af67b0ee6813bc68d04abbe77c32 100644 (file)
@@ -40,8 +40,7 @@ extern int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap);
 extern int dvb_usb_i2c_init(struct dvb_usb_device *);
 extern int dvb_usb_i2c_exit(struct dvb_usb_device *);
 
-extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap,
-                                   short *adapter_nums);
+extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap);
 extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
 extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
 extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
index 0795c2436cc8244b8266f153eef03aebaaf99fb2..41e3194b971eac42b9535a816e7303cb3df4eeb3 100644 (file)
@@ -94,14 +94,13 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
        return dvb_usb_ctrl_feed(dvbdmxfeed,0);
 }
 
-int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
+int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
 {
        int i;
        int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
                                       adap->dev->props.owner,
                                       &adap->dev->udev->dev,
-                                      adapter_nums);
-
+                                      adap->dev->props.adapter_nr);
        if (ret < 0) {
                deb_info("dvb_register_adapter failed: error %d", ret);
                goto err;
index 7334ce6d0379331347280c6d6bf216b25066e7c7..662c25840f3c46ac1921b062a65f21aef8dfcf49 100644 (file)
@@ -26,7 +26,7 @@ static int dvb_usb_force_pid_filter_usage;
 module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
 MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
 
-static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
+static int dvb_usb_adapter_init(struct dvb_usb_device *d)
 {
        struct dvb_usb_adapter *adap;
        int ret, n, o;
@@ -83,7 +83,7 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
                }
 
                if ((ret = dvb_usb_adapter_stream_init(adap)) ||
-                       (ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
+                       (ret = dvb_usb_adapter_dvb_init(adap)) ||
                        (ret = dvb_usb_adapter_frontend_init(adap))) {
                        return ret;
                }
@@ -138,7 +138,7 @@ static int dvb_usb_exit(struct dvb_usb_device *d)
        return 0;
 }
 
-static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
+static int dvb_usb_init(struct dvb_usb_device *d)
 {
        int ret = 0;
 
@@ -158,8 +158,7 @@ static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
        /* check the capabilities and set appropriate variables */
        dvb_usb_device_power_ctrl(d, 1);
 
-       if ((ret = dvb_usb_i2c_init(d)) ||
-               (ret = dvb_usb_adapter_init(d, adapter_nums))) {
+       if ((ret = dvb_usb_i2c_init(d)) || (ret = dvb_usb_adapter_init(d))) {
                dvb_usb_exit(d);
                return ret;
        }
@@ -234,8 +233,7 @@ int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
  * USB
  */
 int dvb_usbv2_device_init(struct usb_interface *intf,
-                       const struct usb_device_id *id,
-                       short *adapter_nums)
+                       const struct usb_device_id *id)
 {
        struct usb_device *udev = interface_to_usbdev(intf);
        struct dvb_usb_device *d = NULL;
@@ -270,7 +268,7 @@ int dvb_usbv2_device_init(struct usb_interface *intf,
 
        usb_set_intfdata(intf, d);
 
-       ret = dvb_usb_init(d, adapter_nums);
+       ret = dvb_usb_init(d);
 
        if (ret == 0)
                info("%s successfully initialized and connected.", desc->name);