[media] dvb_usb_v2: add .init() callback
authorAntti Palosaari <crope@iki.fi>
Wed, 23 May 2012 13:44:15 +0000 (10:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 4 Aug 2012 10:56:19 +0000 (07:56 -0300)
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_init.c

index 95caac116e8e882f5718066c7a0d0b9595a2b9dd..15b08b777e6db1d9a37ca94eff7657f91b3d69db 100644 (file)
@@ -239,6 +239,8 @@ enum dvb_usb_mode {
  * @read_mac_address: called to read the MAC address of the device.
  * @identify_state: called to determine the state (cold or warm), when it
  *  is not distinguishable by the USB IDs.
+ * @init: called after adapters are created in order to finalize device
+ *  configuration.
  *
  * @rc: remote controller properties
  *
@@ -283,6 +285,7 @@ struct dvb_usb_device_properties {
        int (*read_mac_address) (struct dvb_usb_device *, u8 []);
        int (*identify_state)   (struct usb_device *, struct dvb_usb_device_properties *,
                        struct dvb_usb_device_description **, int *);
+       int (*init) (struct dvb_usb_device *);
 
        struct {
                enum dvb_usb_mode mode; /* Drivers shouldn't touch on it */
index 4ae30451eb9e456441e2dc874c455f1c8d8b9bdf..0d769a1c180716865113fd16918781fb9a080ffe 100644 (file)
@@ -164,6 +164,9 @@ static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
                return ret;
        }
 
+       if (d->props.init)
+               d->props.init(d);
+
        if ((ret = dvb_usb_remote_init(d)))
                err("could not initialize remote control.");