Commit f6068764 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] anysee: do not remove CI when it is not attached

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 36f647ba
...@@ -1217,6 +1217,8 @@ static int anysee_ci_init(struct dvb_usb_device *d) ...@@ -1217,6 +1217,8 @@ static int anysee_ci_init(struct dvb_usb_device *d)
if (ret) if (ret)
return ret; return ret;
state->ci_attached = true;
return 0; return 0;
} }
...@@ -1225,7 +1227,7 @@ static void anysee_ci_release(struct dvb_usb_device *d) ...@@ -1225,7 +1227,7 @@ static void anysee_ci_release(struct dvb_usb_device *d)
struct anysee_state *state = d_to_priv(d); struct anysee_state *state = d_to_priv(d);
/* detach CI */ /* detach CI */
if (state->has_ci) if (state->ci_attached)
dvb_ca_en50221_release(&state->ci); dvb_ca_en50221_release(&state->ci);
return; return;
...@@ -1257,10 +1259,8 @@ static int anysee_init(struct dvb_usb_device *d) ...@@ -1257,10 +1259,8 @@ static int anysee_init(struct dvb_usb_device *d)
/* attach CI */ /* attach CI */
if (state->has_ci) { if (state->has_ci) {
ret = anysee_ci_init(d); ret = anysee_ci_init(d);
if (ret) { if (ret)
state->has_ci = false;
return ret; return ret;
}
} }
return 0; return 0;
......
...@@ -56,6 +56,7 @@ struct anysee_state { ...@@ -56,6 +56,7 @@ struct anysee_state {
u8 seq; u8 seq;
u8 fe_id:1; /* frondend ID */ u8 fe_id:1; /* frondend ID */
u8 has_ci:1; u8 has_ci:1;
u8 ci_attached:1;
struct dvb_ca_en50221 ci; struct dvb_ca_en50221 ci;
unsigned long ci_cam_ready; /* jiffies */ unsigned long ci_cam_ready; /* jiffies */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment