From: Michael Krufky Date: Fri, 18 Apr 2008 23:26:04 +0000 (-0300) Subject: V4L/DVB (7943): tuner: add macro, hybrid_tuner_report_instance_count X-Git-Tag: v2.6.26-rc6~96^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9adea1c00df74823e1719ebbcb86c972c4c2aba1;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/common/tuners/tuner-i2c.h b/drivers/media/common/tuners/tuner-i2c.h index 3ad6c8e..cb1c714 100644 --- a/drivers/media/common/tuners/tuner-i2c.h +++ b/drivers/media/common/tuners/tuner-i2c.h @@ -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__ */