summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-02-03 17:58:26 -0500
committerMichael Krufky <mkrufky@linuxtv.org>2008-02-03 17:58:26 -0500
commitac9fa7bdbf76e9a529779421a6d76eef93d175f7 (patch)
tree343a8d1c3152c5615e7ada65cc583358043c2ea0 /linux/drivers/media/video
parent935d6f27369c37df462a015d2046f20c36a23ddd (diff)
downloadmediapointer-dvb-s2-ac9fa7bdbf76e9a529779421a6d76eef93d175f7.tar.gz
mediapointer-dvb-s2-ac9fa7bdbf76e9a529779421a6d76eef93d175f7.tar.bz2
tuner: return number of instances remaining after hybrid_tuner_release_state
From: Michael Krufky <mkrufky@linuxtv.org> 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>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/tuner-i2c.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/linux/drivers/media/video/tuner-i2c.h b/linux/drivers/media/video/tuner-i2c.h
index 8ec5b41d4..c53c327a4 100644
--- a/linux/drivers/media/video/tuner-i2c.h
+++ b/linux/drivers/media/video/tuner-i2c.h
@@ -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__ */