diff options
author | Antti Palosaari <crope@iki.fi> | 2012-09-22 12:46:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-27 14:18:24 -0400 |
commit | f6068764573d2f29529c8835126dabe3f2096c1f (patch) | |
tree | 8c3ae9a5706f96ddf7e3b218eaef3a4cdf19a57f /drivers/media/usb | |
parent | 36f647bad3d35546892c3639328479355da8690d (diff) |
[media] anysee: do not remove CI when it is not attached
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/anysee.c | 8 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/anysee.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/anysee.c b/drivers/media/usb/dvb-usb-v2/anysee.c index 6705d81f0cb2..ec540140c810 100644 --- a/drivers/media/usb/dvb-usb-v2/anysee.c +++ b/drivers/media/usb/dvb-usb-v2/anysee.c | |||
@@ -1217,6 +1217,8 @@ static int anysee_ci_init(struct dvb_usb_device *d) | |||
1217 | if (ret) | 1217 | if (ret) |
1218 | return ret; | 1218 | return ret; |
1219 | 1219 | ||
1220 | state->ci_attached = true; | ||
1221 | |||
1220 | return 0; | 1222 | return 0; |
1221 | } | 1223 | } |
1222 | 1224 | ||
@@ -1225,7 +1227,7 @@ static void anysee_ci_release(struct dvb_usb_device *d) | |||
1225 | struct anysee_state *state = d_to_priv(d); | 1227 | struct anysee_state *state = d_to_priv(d); |
1226 | 1228 | ||
1227 | /* detach CI */ | 1229 | /* detach CI */ |
1228 | if (state->has_ci) | 1230 | if (state->ci_attached) |
1229 | dvb_ca_en50221_release(&state->ci); | 1231 | dvb_ca_en50221_release(&state->ci); |
1230 | 1232 | ||
1231 | return; | 1233 | return; |
@@ -1257,10 +1259,8 @@ static int anysee_init(struct dvb_usb_device *d) | |||
1257 | /* attach CI */ | 1259 | /* attach CI */ |
1258 | if (state->has_ci) { | 1260 | if (state->has_ci) { |
1259 | ret = anysee_ci_init(d); | 1261 | ret = anysee_ci_init(d); |
1260 | if (ret) { | 1262 | if (ret) |
1261 | state->has_ci = false; | ||
1262 | return ret; | 1263 | return ret; |
1263 | } | ||
1264 | } | 1264 | } |
1265 | 1265 | ||
1266 | return 0; | 1266 | return 0; |
diff --git a/drivers/media/usb/dvb-usb-v2/anysee.h b/drivers/media/usb/dvb-usb-v2/anysee.h index 4ab467679a43..c1a4273f14ff 100644 --- a/drivers/media/usb/dvb-usb-v2/anysee.h +++ b/drivers/media/usb/dvb-usb-v2/anysee.h | |||
@@ -56,6 +56,7 @@ struct anysee_state { | |||
56 | u8 seq; | 56 | u8 seq; |
57 | u8 fe_id:1; /* frondend ID */ | 57 | u8 fe_id:1; /* frondend ID */ |
58 | u8 has_ci:1; | 58 | u8 has_ci:1; |
59 | u8 ci_attached:1; | ||
59 | struct dvb_ca_en50221 ci; | 60 | struct dvb_ca_en50221 ci; |
60 | unsigned long ci_cam_ready; /* jiffies */ | 61 | unsigned long ci_cam_ready; /* jiffies */ |
61 | }; | 62 | }; |