Commit c1b4d927 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

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: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent f9e315a1
...@@ -155,13 +155,17 @@ __fail: \ ...@@ -155,13 +155,17 @@ __fail: \
__ret; \ __ret; \
}) })
#define hybrid_tuner_release_state(state) do { \ #define hybrid_tuner_release_state(state) \
({ \
int __ret; \
state->i2c_props.count--; \ state->i2c_props.count--; \
__ret = state->i2c_props.count; \
if (!state->i2c_props.count) { \ if (!state->i2c_props.count) { \
__tuner_info(state->i2c_props, "destroying instance\n");\ __tuner_info(state->i2c_props, "destroying instance\n");\
list_del(&state->hybrid_tuner_instance_list); \ list_del(&state->hybrid_tuner_instance_list); \
kfree(state); \ kfree(state); \
} \ } \
} while (0) __ret; \
})
#endif /* __TUNER_I2C_H__ */ #endif /* __TUNER_I2C_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment