aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-18 19:26:04 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-06-05 05:35:46 -0400
commit9adea1c00df74823e1719ebbcb86c972c4c2aba1 (patch)
tree593f18bc17deebc9fd208831f16f8b1827a02570
parentba60bc673ce7d019ae6684cebbb33e5239346664 (diff)
V4L/DVB (7943): tuner: add macro, hybrid_tuner_report_instance_count
Create a macro to report the number of instances of the tuner driver currently in use. This will allow drivers to perform specific cleanups before destroying the last instance of a tuner. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/common/tuners/tuner-i2c.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/common/tuners/tuner-i2c.h b/drivers/media/common/tuners/tuner-i2c.h
index 3ad6c8e0b04c..cb1c7141f0c6 100644
--- a/drivers/media/common/tuners/tuner-i2c.h
+++ b/drivers/media/common/tuners/tuner-i2c.h
@@ -170,4 +170,12 @@ __fail: \
170 __ret; \ 170 __ret; \
171}) 171})
172 172
173#define hybrid_tuner_report_instance_count(state) \
174({ \
175 int __ret = 0; \
176 if (state) \
177 __ret = state->i2c_props.count; \
178 __ret; \
179})
180
173#endif /* __TUNER_I2C_H__ */ 181#endif /* __TUNER_I2C_H__ */