Skip to content

Commit

Permalink
V4L/DVB (7137): tuner: return number of instances remaining after hyb…
Browse files Browse the repository at this point in the history
…rid_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 <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent f9e315a commit c1b4d92
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/media/video/tuner-i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit c1b4d92

Please sign in to comment.