]> err.no Git - linux-2.6/commitdiff
V4L/DVB (7943): tuner: add macro, hybrid_tuner_report_instance_count
authorMichael Krufky <mkrufky@linuxtv.org>
Fri, 18 Apr 2008 23:26:04 +0000 (20:26 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 5 Jun 2008 09:35:46 +0000 (06:35 -0300)
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>
drivers/media/common/tuners/tuner-i2c.h

index 3ad6c8e0b04ccbd8d612ac89db2f61911b64e225..cb1c7141f0c6d9e96d76110e6ce657ae18148c15 100644 (file)
@@ -170,4 +170,12 @@ __fail:                                                                    \
        __ret;                                                          \
 })
 
+#define hybrid_tuner_report_instance_count(state)                      \
+({                                                                     \
+       int __ret = 0;                                                  \
+       if (state)                                                      \
+               __ret = state->i2c_props.count;                         \
+       __ret;                                                          \
+})
+
 #endif /* __TUNER_I2C_H__ */