]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] dvb-core/en50221: use dvb_remove_device()
authorMax Kellermann <max.kellermann@gmail.com>
Tue, 9 Aug 2016 21:32:16 +0000 (18:32 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 18 Nov 2016 17:03:45 +0000 (15:03 -0200)
Commit da677fe14364 ("[media] dvb-core/en50221: use kref to manage
struct dvb_ca_private") moved the dvb_unregister_device() call to the
kref callback, but that left lots of stale device state visible to
userspace (e.g. in sysfs).  By using dvb_remove_device() and
dvb_free_device() instead of dvb_unregister_device(), we can avoid
that.

Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-core/dvb_ca_en50221.c

index 262a492e7c08469360230f1855d3987787700d4a..fd893141211c49d699fc0c30da01a7eaaa417ba3 100644 (file)
@@ -171,7 +171,7 @@ static void dvb_ca_private_free(struct dvb_ca_private *ca)
 {
        unsigned int i;
 
-       dvb_unregister_device(ca->dvbdev);
+       dvb_free_device(ca->dvbdev);
        for (i = 0; i < ca->slot_count; i++)
                vfree(ca->slot_info[i].rx_buffer.data);
 
@@ -1807,6 +1807,7 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca)
        for (i = 0; i < ca->slot_count; i++) {
                dvb_ca_en50221_slot_shutdown(ca, i);
        }
+       dvb_remove_device(ca->dvbdev);
        dvb_ca_private_put(ca);
        pubca->private = NULL;
 }