Skip to content

Commit

Permalink
rfkill: document the rfkill struct locking (v2)
Browse files Browse the repository at this point in the history
Reorder fields in struct rfkill and add comments to make it clear
which fields are protected by rfkill->mutex.

Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Acked-by: Ivo van Doorn <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
hmh authored and linvjw committed Jul 29, 2008
1 parent 37f55e9 commit f1b2336
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/linux/rfkill.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ enum rfkill_state {
* @user_claim_unsupported: Whether the hardware supports exclusive
* RF-kill control by userspace. Set this before registering.
* @user_claim: Set when the switch is controlled exlusively by userspace.
* @mutex: Guards switch state transitions
* @mutex: Guards switch state transitions. It serializes callbacks
* and also protects the state.
* @data: Pointer to the RF button drivers private data which will be
* passed along when toggling radio state.
* @toggle_radio(): Mandatory handler to control state of the radio.
Expand All @@ -89,12 +90,13 @@ struct rfkill {
const char *name;
enum rfkill_type type;

enum rfkill_state state;
bool user_claim_unsupported;
bool user_claim;

/* the mutex serializes callbacks and also protects
* the state */
struct mutex mutex;

enum rfkill_state state;
void *data;
int (*toggle_radio)(void *data, enum rfkill_state state);
int (*get_state)(void *data, enum rfkill_state *state);
Expand Down

0 comments on commit f1b2336

Please sign in to comment.