aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-i2c.h
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 13:42:00 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 12:42:27 -0400
commitc1b4d92789ada9ea6b7f1156ede7022eab309eab (patch)
tree77f6f4e0d38019f111b80d80486d032b9333262c /drivers/media/video/tuner-i2c.h
parentf9e315a16a5536120bac09a6d4217b8381c73c5c (diff)
V4L/DVB (7137): tuner: return number of instances remaining after hybrid_tuner_release_state
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>
Diffstat (limited to 'drivers/media/video/tuner-i2c.h')
-rw-r--r--drivers/media/video/tuner-i2c.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/video/tuner-i2c.h b/drivers/media/video/tuner-i2c.h
index 8ec5b41d459f..c53c327a487c 100644
--- a/drivers/media/video/tuner-i2c.h
+++ b/drivers/media/video/tuner-i2c.h
@@ -155,13 +155,17 @@ __fail: \
155 __ret; \ 155 __ret; \
156}) 156})
157 157
158#define hybrid_tuner_release_state(state) do { \ 158#define hybrid_tuner_release_state(state) \
159({ \
160 int __ret; \
159 state->i2c_props.count--; \ 161 state->i2c_props.count--; \
162 __ret = state->i2c_props.count; \
160 if (!state->i2c_props.count) { \ 163 if (!state->i2c_props.count) { \
161 __tuner_info(state->i2c_props, "destroying instance\n");\ 164 __tuner_info(state->i2c_props, "destroying instance\n");\
162 list_del(&state->hybrid_tuner_instance_list); \ 165 list_del(&state->hybrid_tuner_instance_list); \
163 kfree(state); \ 166 kfree(state); \
164 } \ 167 } \
165} while (0) 168 __ret; \
169})
166 170
167#endif /* __TUNER_I2C_H__ */ 171#endif /* __TUNER_I2C_H__ */