From: Michael Krufky Date: Tue, 22 Apr 2008 17:42:00 +0000 (-0300) Subject: V4L/DVB (7137): tuner: return number of instances remaining after hybrid_tuner_releas... X-Git-Tag: firefly_0821_release~21561^2~435 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c1b4d92789ada9ea6b7f1156ede7022eab309eab;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Mauro Carvalho Chehab --- 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: \ __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__ */