Please try the attached patch, and tell me if it fixes the issue.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
commit 052fa8baa08f0a2ff4f2f1f4bdee9fbd99e06063
Author: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>
Date: Thu Jul 3 11:43:26 2008 -0300
rfkill: allow toggle_radio errors when registering
rfkill_add_switch() calls rfkill_toggle_radio() to set the radio of a
recently registered rfkill class to the current global state [for that
rfkill->type].
And the rfkill_toggle_radio() call is going to error out if the radio is
RFKILL_STATE_HARD_BLOCKED, and the global state is RFKILL_STATE_UNBLOCKED.
That is a quite normal situation which I missed to account for. This
causes rfkill_register to bail out with an error.
Change rfkill_add_switch() to not return errors because of a failed call to
rfkill_toggle_radio(). Whether that implicit call suceeded or not has no
bearing on whether a new rfkill class should register sucessfully or not.
Bug reported by "kionez <kionez@xxxxxxxx>".
Signed-off-by: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>
Cc: Ivo van Doorn <IvDoorn@xxxxxxxxx>
Cc: kionez <kionez@xxxxxxxx>
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index aa7039d..7a560b7 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -501,17 +501,15 @@ static struct class rfkill_class = {
static int rfkill_add_switch(struct rfkill *rfkill)
{
- int error;
-
mutex_lock(&rfkill_mutex);
- error = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type], 0);
- if (!error)
- list_add_tail(&rfkill->node, &rfkill_list);
+ rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type], 0);
+
+ list_add_tail(&rfkill->node, &rfkill_list);
mutex_unlock(&rfkill_mutex);
- return error;
+ return 0;
}
static void rfkill_remove_switch(struct rfkill *rfkill)
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel