]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] anysee: do not remove CI when it is not attached
authorAntti Palosaari <crope@iki.fi>
Sat, 22 Sep 2012 16:46:24 +0000 (13:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 27 Sep 2012 18:18:24 +0000 (15:18 -0300)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/dvb-usb-v2/anysee.c
drivers/media/usb/dvb-usb-v2/anysee.h

index 6705d81f0cb2f174f6417e8ef1c20d2ed71e1442..ec540140c81037ffb0317a3d726fbd30e58fa94e 100644 (file)
@@ -1217,6 +1217,8 @@ static int anysee_ci_init(struct dvb_usb_device *d)
        if (ret)
                return ret;
 
+       state->ci_attached = true;
+
        return 0;
 }
 
@@ -1225,7 +1227,7 @@ static void anysee_ci_release(struct dvb_usb_device *d)
        struct anysee_state *state = d_to_priv(d);
 
        /* detach CI */
-       if (state->has_ci)
+       if (state->ci_attached)
                dvb_ca_en50221_release(&state->ci);
 
        return;
@@ -1257,10 +1259,8 @@ static int anysee_init(struct dvb_usb_device *d)
        /* attach CI */
        if (state->has_ci) {
                ret = anysee_ci_init(d);
-               if (ret) {
-                       state->has_ci = false;
+               if (ret)
                        return ret;
-               }
        }
 
        return 0;
index 4ab467679a437fdf6a6fef10fa370671c4894811..c1a4273f14ff8075f4e881fca7243b8197d4cc1a 100644 (file)
@@ -56,6 +56,7 @@ struct anysee_state {
        u8 seq;
        u8 fe_id:1; /* frondend ID */
        u8 has_ci:1;
+       u8 ci_attached:1;
        struct dvb_ca_en50221 ci;
        unsigned long ci_cam_ready; /* jiffies */
 };