V4L/DVB (7137): tuner: return number of instances remaining after hybrid_tuner_releas...
authorMichael Krufky <mkrufky@linuxtv.org>
Tue, 22 Apr 2008 17:42:00 +0000 (14:42 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 16:42:27 +0000 (13:42 -0300)
Assign the number of instances remaining as the return value of
hybrid_tuner_release_state, in case there is any extra cleanup that
the tuner driver needs to do after an instance has been destroyed.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tuner-i2c.h

index 8ec5b41d459f240dddce67feb3265c07018c677e..c53c327a487ccfe7b09c16b51ee5bfffe50f42ec 100644 (file)
@@ -155,13 +155,17 @@ __fail:                                                                   \
        __ret;                                                          \
 })
 
-#define hybrid_tuner_release_state(state) do {                         \
+#define hybrid_tuner_release_state(state)                              \
+({                                                                     \
+       int __ret;                                                      \
        state->i2c_props.count--;                                       \
+       __ret = state->i2c_props.count;                                 \
        if (!state->i2c_props.count) {                                  \
                __tuner_info(state->i2c_props, "destroying instance\n");\
                list_del(&state->hybrid_tuner_instance_list);           \
                kfree(state);                                           \
        }                                                               \
-} while (0)
+       __ret;                                                          \
+})
 
 #endif /* __TUNER_I2C_H__ */