Skip to content

Commit

Permalink
[media] dvb_frontend: add "detach" callback
Browse files Browse the repository at this point in the history
Prepare for making "release" asynchronous (via kref).  Some operations
may need to be run synchronously in dvb_frontend_detach(), and that's
why we need a "detach" callback.

Signed-off-by: Max Kellermann <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
MaxKellermann authored and mchehab committed Nov 18, 2016
1 parent 967d8e8 commit d812b3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/media/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,7 @@ void dvb_frontend_detach(struct dvb_frontend* fe)
dvb_frontend_invoke_release(fe, fe->ops.release_sec);
dvb_frontend_invoke_release(fe, fe->ops.tuner_ops.release);
dvb_frontend_invoke_release(fe, fe->ops.analog_ops.release);
dvb_frontend_invoke_release(fe, fe->ops.detach);
dvb_frontend_invoke_release(fe, fe->ops.release);
}
EXPORT_SYMBOL(dvb_frontend_detach);
7 changes: 6 additions & 1 deletion drivers/media/dvb-core/dvb_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ struct dtv_frontend_properties;
*
* @info: embedded struct dvb_tuner_info with tuner properties
* @delsys: Delivery systems supported by the frontend
* @release: callback function called when frontend is dettached.
* @detach: callback function called when frontend is detached.
* drivers should clean up, but not yet free the struct
* dvb_frontend allocation.
* @release: callback function called when frontend is ready to be
* freed.
* drivers should free any allocated memory.
* @release_sec: callback function requesting that the Satelite Equipment
* Control (SEC) driver to release and free any memory
Expand Down Expand Up @@ -415,6 +419,7 @@ struct dvb_frontend_ops {

u8 delsys[MAX_DELSYS];

void (*detach)(struct dvb_frontend *fe);
void (*release)(struct dvb_frontend* fe);
void (*release_sec)(struct dvb_frontend* fe);

Expand Down

0 comments on commit d812b3c

Please sign in to comment.