Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73536
b: refs/heads/master
c: 7319f1e
h: refs/heads/master
v: v3
  • Loading branch information
Michael Buesch authored and David S. Miller committed Nov 11, 2007
1 parent c1f46c5 commit 458d00d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f51359a8fb1bb00ae87051991e59d0f92d90604b
refs/heads/master: 7319f1e6bcf04abd2eddb19747b0933a76f839ce
20 changes: 9 additions & 11 deletions trunk/net/rfkill/rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,17 @@ static struct class rfkill_class = {

static int rfkill_add_switch(struct rfkill *rfkill)
{
int retval;

retval = mutex_lock_interruptible(&rfkill_mutex);
if (retval)
return retval;
int error;

retval = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]);
if (retval)
goto out;
mutex_lock(&rfkill_mutex);

list_add_tail(&rfkill->node, &rfkill_list);
error = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]);
if (!error)
list_add_tail(&rfkill->node, &rfkill_list);

out:
mutex_unlock(&rfkill_mutex);
return retval;

return error;
}

static void rfkill_remove_switch(struct rfkill *rfkill)
Expand Down Expand Up @@ -387,6 +383,8 @@ int rfkill_register(struct rfkill *rfkill)

if (!rfkill->toggle_radio)
return -EINVAL;
if (rfkill->type >= RFKILL_TYPE_MAX)
return -EINVAL;

snprintf(dev->bus_id, sizeof(dev->bus_id),
"rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1);
Expand Down

0 comments on commit 458d00d

Please sign in to comment.