Lines Matching refs:ca

156 static void dvb_ca_private_free(struct dvb_ca_private *ca)  in dvb_ca_private_free()  argument
160 dvb_device_put(ca->dvbdev); in dvb_ca_private_free()
161 for (i = 0; i < ca->slot_count; i++) in dvb_ca_private_free()
162 vfree(ca->slot_info[i].rx_buffer.data); in dvb_ca_private_free()
164 kfree(ca->slot_info); in dvb_ca_private_free()
165 kfree(ca); in dvb_ca_private_free()
170 struct dvb_ca_private *ca; in dvb_ca_private_release() local
172 ca = container_of(ref, struct dvb_ca_private, refcount); in dvb_ca_private_release()
173 dvb_ca_private_free(ca); in dvb_ca_private_release()
176 static void dvb_ca_private_get(struct dvb_ca_private *ca) in dvb_ca_private_get() argument
178 kref_get(&ca->refcount); in dvb_ca_private_get()
181 static void dvb_ca_private_put(struct dvb_ca_private *ca) in dvb_ca_private_put() argument
183 kref_put(&ca->refcount, dvb_ca_private_release); in dvb_ca_private_put()
186 static void dvb_ca_en50221_thread_wakeup(struct dvb_ca_private *ca);
187 static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot,
189 static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
222 static int dvb_ca_en50221_check_camstatus(struct dvb_ca_private *ca, int slot) in dvb_ca_en50221_check_camstatus() argument
224 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_check_camstatus()
230 if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE) in dvb_ca_en50221_check_camstatus()
234 slot_status = ca->pub->poll_slot_status(ca->pub, slot, ca->open); in dvb_ca_en50221_check_camstatus()
272 static int dvb_ca_en50221_wait_if_status(struct dvb_ca_private *ca, int slot, in dvb_ca_en50221_wait_if_status() argument
287 res = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); in dvb_ca_en50221_wait_if_status()
320 static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot) in dvb_ca_en50221_link_init() argument
322 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_link_init()
339 ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, in dvb_ca_en50221_link_init()
343 ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ); in dvb_ca_en50221_link_init()
346 ret = dvb_ca_en50221_read_data(ca, slot, buf, 2); in dvb_ca_en50221_link_init()
349 ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN); in dvb_ca_en50221_link_init()
366 ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, in dvb_ca_en50221_link_init()
370 ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_FR, HZ / 10); in dvb_ca_en50221_link_init()
373 ret = dvb_ca_en50221_write_data(ca, slot, buf, 2); in dvb_ca_en50221_link_init()
376 ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN); in dvb_ca_en50221_link_init()
396 static int dvb_ca_en50221_read_tuple(struct dvb_ca_private *ca, int slot, in dvb_ca_en50221_read_tuple() argument
406 _tuple_type = ca->pub->read_attribute_mem(ca->pub, slot, _address); in dvb_ca_en50221_read_tuple()
416 _tuple_length = ca->pub->read_attribute_mem(ca->pub, slot, in dvb_ca_en50221_read_tuple()
426 tuple[i] = ca->pub->read_attribute_mem(ca->pub, slot, in dvb_ca_en50221_read_tuple()
450 static int dvb_ca_en50221_parse_attributes(struct dvb_ca_private *ca, int slot) in dvb_ca_en50221_parse_attributes() argument
467 status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type, in dvb_ca_en50221_parse_attributes()
475 status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type, in dvb_ca_en50221_parse_attributes()
483 status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type, in dvb_ca_en50221_parse_attributes()
491 status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type, in dvb_ca_en50221_parse_attributes()
503 status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tuple_type, in dvb_ca_en50221_parse_attributes()
516 sl = &ca->slot_info[slot]; in dvb_ca_en50221_parse_attributes()
531 ca->dvbdev->adapter->num, dvb_str[8], dvb_str[9], in dvb_ca_en50221_parse_attributes()
538 status = dvb_ca_en50221_read_tuple(ca, slot, &address, in dvb_ca_en50221_parse_attributes()
595 static int dvb_ca_en50221_set_configoption(struct dvb_ca_private *ca, int slot) in dvb_ca_en50221_set_configoption() argument
597 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_set_configoption()
603 ca->pub->write_attribute_mem(ca->pub, slot, sl->config_base, in dvb_ca_en50221_set_configoption()
607 configoption = ca->pub->read_attribute_mem(ca->pub, slot, in dvb_ca_en50221_set_configoption()
631 static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, in dvb_ca_en50221_read_data() argument
634 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_read_data()
659 if (ca->pub->read_data && in dvb_ca_en50221_read_data()
662 status = ca->pub->read_data(ca->pub, slot, buf, in dvb_ca_en50221_read_data()
665 status = ca->pub->read_data(ca->pub, slot, buf, ecount); in dvb_ca_en50221_read_data()
673 status = ca->pub->read_cam_control(ca->pub, slot, in dvb_ca_en50221_read_data()
684 status = ca->pub->read_cam_control(ca->pub, slot, in dvb_ca_en50221_read_data()
689 status = ca->pub->read_cam_control(ca->pub, slot, in dvb_ca_en50221_read_data()
699 ca->dvbdev->adapter->num, bytes_read, in dvb_ca_en50221_read_data()
707 ca->dvbdev->adapter->num); in dvb_ca_en50221_read_data()
715 ca->dvbdev->adapter->num); in dvb_ca_en50221_read_data()
724 status = ca->pub->read_cam_control(ca->pub, slot, in dvb_ca_en50221_read_data()
734 status = ca->pub->read_cam_control(ca->pub, slot, in dvb_ca_en50221_read_data()
764 wake_up_interruptible(&ca->wait_queue); in dvb_ca_en50221_read_data()
784 static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, in dvb_ca_en50221_write_data() argument
787 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_write_data()
797 if (ca->pub->write_data && in dvb_ca_en50221_write_data()
799 return ca->pub->write_data(ca->pub, slot, buf, bytes_write); in dvb_ca_en50221_write_data()
807 status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); in dvb_ca_en50221_write_data()
812 dvb_ca_en50221_thread_wakeup(ca); in dvb_ca_en50221_write_data()
819 status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, in dvb_ca_en50221_write_data()
825 status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); in dvb_ca_en50221_write_data()
845 status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); in dvb_ca_en50221_write_data()
851 dvb_ca_en50221_thread_wakeup(ca); in dvb_ca_en50221_write_data()
858 status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_SIZE_HIGH, in dvb_ca_en50221_write_data()
862 status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_SIZE_LOW, in dvb_ca_en50221_write_data()
869 status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_DATA, in dvb_ca_en50221_write_data()
876 status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); in dvb_ca_en50221_write_data()
890 ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN); in dvb_ca_en50221_write_data()
905 static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot) in dvb_ca_en50221_slot_shutdown() argument
909 ca->pub->slot_shutdown(ca->pub, slot); in dvb_ca_en50221_slot_shutdown()
910 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; in dvb_ca_en50221_slot_shutdown()
916 wake_up_interruptible(&ca->wait_queue); in dvb_ca_en50221_slot_shutdown()
934 struct dvb_ca_private *ca = pubca->private; in dvb_ca_en50221_camchange_irq() local
935 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_camchange_irq()
950 dvb_ca_en50221_thread_wakeup(ca); in dvb_ca_en50221_camchange_irq()
962 struct dvb_ca_private *ca = pubca->private; in dvb_ca_en50221_camready_irq() local
963 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_camready_irq()
969 dvb_ca_en50221_thread_wakeup(ca); in dvb_ca_en50221_camready_irq()
982 struct dvb_ca_private *ca = pubca->private; in dvb_ca_en50221_frda_irq() local
983 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_frda_irq()
990 flags = ca->pub->read_cam_control(pubca, slot, CTRLIF_STATUS); in dvb_ca_en50221_frda_irq()
998 if (ca->open) in dvb_ca_en50221_frda_irq()
999 dvb_ca_en50221_thread_wakeup(ca); in dvb_ca_en50221_frda_irq()
1013 static void dvb_ca_en50221_thread_wakeup(struct dvb_ca_private *ca) in dvb_ca_en50221_thread_wakeup() argument
1017 ca->wakeup = 1; in dvb_ca_en50221_thread_wakeup()
1019 wake_up_process(ca->thread); in dvb_ca_en50221_thread_wakeup()
1027 static void dvb_ca_en50221_thread_update_delay(struct dvb_ca_private *ca) in dvb_ca_en50221_thread_update_delay() argument
1037 for (slot = 0; slot < ca->slot_count; slot++) { in dvb_ca_en50221_thread_update_delay()
1038 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_thread_update_delay()
1044 if (!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) in dvb_ca_en50221_thread_update_delay()
1049 if (!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) in dvb_ca_en50221_thread_update_delay()
1063 if (!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) in dvb_ca_en50221_thread_update_delay()
1065 if (ca->open) { in dvb_ca_en50221_thread_update_delay()
1067 (!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_DA))) in dvb_ca_en50221_thread_update_delay()
1077 ca->delay = curdelay; in dvb_ca_en50221_thread_update_delay()
1089 static int dvb_ca_en50221_poll_cam_gone(struct dvb_ca_private *ca, int slot) in dvb_ca_en50221_poll_cam_gone() argument
1098 if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) && in dvb_ca_en50221_poll_cam_gone()
1099 (ca->pub->poll_slot_status)) { in dvb_ca_en50221_poll_cam_gone()
1100 status = ca->pub->poll_slot_status(ca->pub, slot, 0); in dvb_ca_en50221_poll_cam_gone()
1103 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; in dvb_ca_en50221_poll_cam_gone()
1104 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_poll_cam_gone()
1118 static void dvb_ca_en50221_thread_state_machine(struct dvb_ca_private *ca, in dvb_ca_en50221_thread_state_machine() argument
1121 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_thread_state_machine()
1129 while (dvb_ca_en50221_check_camstatus(ca, slot)) { in dvb_ca_en50221_thread_state_machine()
1132 dvb_ca_en50221_slot_shutdown(ca, slot); in dvb_ca_en50221_thread_state_machine()
1139 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1152 ca->pub->slot_reset(ca->pub, slot); in dvb_ca_en50221_thread_state_machine()
1159 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1161 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1171 if (dvb_ca_en50221_parse_attributes(ca, slot) != 0) { in dvb_ca_en50221_thread_state_machine()
1172 if (dvb_ca_en50221_poll_cam_gone(ca, slot)) in dvb_ca_en50221_thread_state_machine()
1176 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1178 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1181 if (dvb_ca_en50221_set_configoption(ca, slot) != 0) { in dvb_ca_en50221_thread_state_machine()
1183 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1185 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1188 if (ca->pub->write_cam_control(ca->pub, slot, in dvb_ca_en50221_thread_state_machine()
1192 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1194 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1201 ca->wakeup = 1; in dvb_ca_en50221_thread_state_machine()
1207 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1209 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1213 flags = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS); in dvb_ca_en50221_thread_state_machine()
1216 ca->wakeup = 1; in dvb_ca_en50221_thread_state_machine()
1221 if (dvb_ca_en50221_link_init(ca, slot) != 0) { in dvb_ca_en50221_thread_state_machine()
1222 if (dvb_ca_en50221_poll_cam_gone(ca, slot)) in dvb_ca_en50221_thread_state_machine()
1226 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1228 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1236 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1238 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1245 ca->pub->slot_ts_enable(ca->pub, slot); in dvb_ca_en50221_thread_state_machine()
1247 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread_state_machine()
1249 ca->dvbdev->adapter->num); in dvb_ca_en50221_thread_state_machine()
1253 if (!ca->open) in dvb_ca_en50221_thread_state_machine()
1258 while (dvb_ca_en50221_read_data(ca, slot, NULL, 0) > 0) { in dvb_ca_en50221_thread_state_machine()
1259 if (!ca->open) in dvb_ca_en50221_thread_state_machine()
1266 if (dvb_ca_en50221_check_camstatus(ca, slot)) { in dvb_ca_en50221_thread_state_machine()
1271 ca->wakeup = 1; in dvb_ca_en50221_thread_state_machine()
1281 ca->wakeup = 1; in dvb_ca_en50221_thread_state_machine()
1297 struct dvb_ca_private *ca = data; in dvb_ca_en50221_thread() local
1303 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_thread()
1308 if (!ca->wakeup) { in dvb_ca_en50221_thread()
1310 schedule_timeout(ca->delay); in dvb_ca_en50221_thread()
1314 ca->wakeup = 0; in dvb_ca_en50221_thread()
1317 for (slot = 0; slot < ca->slot_count; slot++) in dvb_ca_en50221_thread()
1318 dvb_ca_en50221_thread_state_machine(ca, slot); in dvb_ca_en50221_thread()
1342 struct dvb_ca_private *ca = dvbdev->priv; in dvb_ca_en50221_io_do_ioctl() local
1348 if (mutex_lock_interruptible(&ca->ioctl_mutex)) in dvb_ca_en50221_io_do_ioctl()
1353 for (slot = 0; slot < ca->slot_count; slot++) { in dvb_ca_en50221_io_do_ioctl()
1354 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_io_do_ioctl()
1358 dvb_ca_en50221_slot_shutdown(ca, slot); in dvb_ca_en50221_io_do_ioctl()
1359 if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE) in dvb_ca_en50221_io_do_ioctl()
1360 dvb_ca_en50221_camchange_irq(ca->pub, in dvb_ca_en50221_io_do_ioctl()
1366 ca->next_read_slot = 0; in dvb_ca_en50221_io_do_ioctl()
1367 dvb_ca_en50221_thread_wakeup(ca); in dvb_ca_en50221_io_do_ioctl()
1373 caps->slot_num = ca->slot_count; in dvb_ca_en50221_io_do_ioctl()
1385 if ((slot >= ca->slot_count) || (slot < 0)) { in dvb_ca_en50221_io_do_ioctl()
1389 slot = array_index_nospec(slot, ca->slot_count); in dvb_ca_en50221_io_do_ioctl()
1393 sl = &ca->slot_info[slot]; in dvb_ca_en50221_io_do_ioctl()
1409 mutex_unlock(&ca->ioctl_mutex); in dvb_ca_en50221_io_do_ioctl()
1443 struct dvb_ca_private *ca = dvbdev->priv; in dvb_ca_en50221_io_write() local
1470 if (slot >= ca->slot_count) in dvb_ca_en50221_io_write()
1472 slot = array_index_nospec(slot, ca->slot_count); in dvb_ca_en50221_io_write()
1473 sl = &ca->slot_info[slot]; in dvb_ca_en50221_io_write()
1510 status = dvb_ca_en50221_write_data(ca, slot, fragbuf, in dvb_ca_en50221_io_write()
1538 static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, in dvb_ca_en50221_io_read_condition() argument
1549 slot = ca->next_read_slot; in dvb_ca_en50221_io_read_condition()
1550 while ((slot_count < ca->slot_count) && (!found)) { in dvb_ca_en50221_io_read_condition()
1551 struct dvb_ca_slot *sl = &ca->slot_info[slot]; in dvb_ca_en50221_io_read_condition()
1576 slot = (slot + 1) % ca->slot_count; in dvb_ca_en50221_io_read_condition()
1580 ca->next_read_slot = slot; in dvb_ca_en50221_io_read_condition()
1598 struct dvb_ca_private *ca = dvbdev->priv; in dvb_ca_en50221_io_read() local
1621 status = dvb_ca_en50221_io_read_condition(ca, &result, &slot); in dvb_ca_en50221_io_read()
1628 status = wait_event_interruptible(ca->wait_queue, in dvb_ca_en50221_io_read()
1630 (ca, &result, &slot)); in dvb_ca_en50221_io_read()
1638 sl = &ca->slot_info[slot]; in dvb_ca_en50221_io_read()
1644 ca->dvbdev->adapter->num); in dvb_ca_en50221_io_read()
1706 struct dvb_ca_private *ca = dvbdev->priv; in dvb_ca_en50221_io_open() local
1712 if (!try_module_get(ca->pub->owner)) in dvb_ca_en50221_io_open()
1717 module_put(ca->pub->owner); in dvb_ca_en50221_io_open()
1721 for (i = 0; i < ca->slot_count; i++) { in dvb_ca_en50221_io_open()
1722 struct dvb_ca_slot *sl = &ca->slot_info[i]; in dvb_ca_en50221_io_open()
1736 ca->open = 1; in dvb_ca_en50221_io_open()
1737 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_io_open()
1738 dvb_ca_en50221_thread_wakeup(ca); in dvb_ca_en50221_io_open()
1740 dvb_ca_private_get(ca); in dvb_ca_en50221_io_open()
1756 struct dvb_ca_private *ca = dvbdev->priv; in dvb_ca_en50221_io_release() local
1762 ca->open = 0; in dvb_ca_en50221_io_release()
1763 dvb_ca_en50221_thread_update_delay(ca); in dvb_ca_en50221_io_release()
1767 module_put(ca->pub->owner); in dvb_ca_en50221_io_release()
1769 dvb_ca_private_put(ca); in dvb_ca_en50221_io_release()
1785 struct dvb_ca_private *ca = dvbdev->priv; in dvb_ca_en50221_io_poll() local
1792 poll_wait(file, &ca->wait_queue, wait); in dvb_ca_en50221_io_poll()
1794 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) in dvb_ca_en50221_io_poll()
1801 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) in dvb_ca_en50221_io_poll()
1846 struct dvb_ca_private *ca = NULL; in dvb_ca_en50221_init() local
1855 ca = kzalloc(sizeof(*ca), GFP_KERNEL); in dvb_ca_en50221_init()
1856 if (!ca) { in dvb_ca_en50221_init()
1860 kref_init(&ca->refcount); in dvb_ca_en50221_init()
1861 ca->pub = pubca; in dvb_ca_en50221_init()
1862 ca->flags = flags; in dvb_ca_en50221_init()
1863 ca->slot_count = slot_count; in dvb_ca_en50221_init()
1864 ca->slot_info = kcalloc(slot_count, sizeof(struct dvb_ca_slot), in dvb_ca_en50221_init()
1866 if (!ca->slot_info) { in dvb_ca_en50221_init()
1870 init_waitqueue_head(&ca->wait_queue); in dvb_ca_en50221_init()
1871 ca->open = 0; in dvb_ca_en50221_init()
1872 ca->wakeup = 0; in dvb_ca_en50221_init()
1873 ca->next_read_slot = 0; in dvb_ca_en50221_init()
1874 pubca->private = ca; in dvb_ca_en50221_init()
1877 ret = dvb_register_device(dvb_adapter, &ca->dvbdev, &dvbdev_ca, ca, in dvb_ca_en50221_init()
1884 struct dvb_ca_slot *sl = &ca->slot_info[i]; in dvb_ca_en50221_init()
1893 mutex_init(&ca->ioctl_mutex); in dvb_ca_en50221_init()
1902 ca->thread = kthread_run(dvb_ca_en50221_thread, ca, "kdvb-ca-%i:%i", in dvb_ca_en50221_init()
1903 ca->dvbdev->adapter->num, ca->dvbdev->id); in dvb_ca_en50221_init()
1904 if (IS_ERR(ca->thread)) { in dvb_ca_en50221_init()
1905 ret = PTR_ERR(ca->thread); in dvb_ca_en50221_init()
1913 dvb_unregister_device(ca->dvbdev); in dvb_ca_en50221_init()
1915 kfree(ca->slot_info); in dvb_ca_en50221_init()
1917 kfree(ca); in dvb_ca_en50221_init()
1931 struct dvb_ca_private *ca = pubca->private; in dvb_ca_en50221_release() local
1937 kthread_stop(ca->thread); in dvb_ca_en50221_release()
1939 for (i = 0; i < ca->slot_count; i++) in dvb_ca_en50221_release()
1940 dvb_ca_en50221_slot_shutdown(ca, i); in dvb_ca_en50221_release()
1942 dvb_remove_device(ca->dvbdev); in dvb_ca_en50221_release()
1943 dvb_ca_private_put(ca); in dvb_ca_en50221_release()