[media] dvbdev: add a dvb_detach() macro
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 29 May 2014 12:20:13 +0000 (09:20 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 17 Jun 2014 15:04:47 +0000 (12:04 -0300)
The dvb_attach() was unbalanced, as there was no dvb_dettach. Ok,
on current cases, the dettach is done by dvbdev, but that are some
future corner cases where we may need to do this before registering
the frontend.

So, add a dvb_detach() and use it at dvb_frontend.c.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/dvb-core/dvb_frontend.c
drivers/media/dvb-core/dvbdev.h

index 6ce435ac866f06d5689f3ee9f71a0d91c9ade143..6cc2631d8f0e29e6637b1a9c06c0bcbeca2d9bbc 100644 (file)
@@ -2666,20 +2666,20 @@ void dvb_frontend_detach(struct dvb_frontend* fe)
 
        if (fe->ops.release_sec) {
                fe->ops.release_sec(fe);
-               symbol_put_addr(fe->ops.release_sec);
+               dvb_detach(fe->ops.release_sec);
        }
        if (fe->ops.tuner_ops.release) {
                fe->ops.tuner_ops.release(fe);
-               symbol_put_addr(fe->ops.tuner_ops.release);
+               dvb_detach(fe->ops.tuner_ops.release);
        }
        if (fe->ops.analog_ops.release) {
                fe->ops.analog_ops.release(fe);
-               symbol_put_addr(fe->ops.analog_ops.release);
+               dvb_detach(fe->ops.analog_ops.release);
        }
        ptr = (void*)fe->ops.release;
        if (ptr) {
                fe->ops.release(fe);
-               symbol_put_addr(ptr);
+               dvb_detach(ptr);
        }
 }
 #else
index 93a9470d3f0c7c19d3d9391bdc37a27ac66a7e6e..f96b28e7fc952f210000b39879e91fb29192d292 100644 (file)
@@ -136,11 +136,15 @@ extern int dvb_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
        __r; \
 })
 
+#define dvb_detach(FUNC)       symbol_put_addr(FUNC)
+
 #else
 #define dvb_attach(FUNCTION, ARGS...) ({ \
        FUNCTION(ARGS); \
 })
 
+#define dvb_detach(FUNC)       {}
+
 #endif
 
 #endif /* #ifndef _DVBDEV_H_ */