Skip to content

Commit

Permalink
Fix logic error in rfkill_check_duplicity
Browse files Browse the repository at this point in the history
> I'll have a prod at why the [hso] rfkill stuff isn't working next

Ok, I believe this is due to the addition of rfkill_check_duplicity in
rfkill and the fact that test_bit actually returns a negative value
rather than the postive one expected (which is of course equally true).
So when the second WLAN device (the hso device, with the EEE PC WLAN
being the first) comes along rfkill_check_duplicity returns a negative
value and so rfkill_register returns an error. Patch below fixes this
for me.

Signed-Off-By: Jonathan McDowell <noodles@earth.li>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jonathan McDowell authored and John W. Linville committed Nov 6, 2008
1 parent 964d277 commit 4a9d916
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rfkill/rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ static int rfkill_check_duplicity(const struct rfkill *rfkill)
}

/* 0: first switch of its kind */
return test_bit(rfkill->type, seen);
return (test_bit(rfkill->type, seen)) ? 1 : 0;
}

static int rfkill_add_switch(struct rfkill *rfkill)
Expand Down

0 comments on commit 4a9d916

Please sign in to comment.