Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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__ */