]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
rfkill: remove deprecated state constants
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 30 Mar 2009 09:32:46 +0000 (11:32 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Apr 2009 20:54:27 +0000 (16:54 -0400)
I only did superficial review, but these constants are stupid
to have and without proper warnings nobody will review the
code anyway, no amount of shouting will help.

Also fix wimax to use correct states.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
arch/arm/mach-pxa/tosa-bt.c
drivers/net/usb/hso.c
include/linux/rfkill.h
net/wimax/op-rfkill.c

index fb0294bd43107442d4a0f3f569f67caf4ba59c29..bde42aa29374ad06fc9311b3f995809c12c17397 100644 (file)
@@ -38,9 +38,9 @@ static void tosa_bt_off(struct tosa_bt_data *data)
 static int tosa_bt_toggle_radio(void *data, enum rfkill_state state)
 {
        pr_info("BT_RADIO going: %s\n",
-                       state == RFKILL_STATE_ON ? "on" : "off");
+                       state == RFKILL_STATE_UNBLOCKED ? "on" : "off");
 
-       if (state == RFKILL_STATE_ON) {
+       if (state == RFKILL_STATE_UNBLOCKED) {
                pr_info("TOSA_BT: going ON\n");
                tosa_bt_on(data);
        } else {
index f84b78d94c400f0533a34a1a568b9e6507f0a1f0..d696e5fbc176b424dc8d2f1b19ede54f7ec30d99 100644 (file)
@@ -2484,7 +2484,7 @@ static int add_net_device(struct hso_device *hso_dev)
 static int hso_radio_toggle(void *data, enum rfkill_state state)
 {
        struct hso_device *hso_dev = data;
-       int enabled = (state == RFKILL_STATE_ON);
+       int enabled = (state == RFKILL_STATE_UNBLOCKED);
        int rv;
 
        mutex_lock(&hso_dev->mutex);
@@ -2522,7 +2522,7 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
        snprintf(rfkn, 20, "hso-%d",
                 interface->altsetting->desc.bInterfaceNumber);
        hso_net->rfkill->name = rfkn;
-       hso_net->rfkill->state = RFKILL_STATE_ON;
+       hso_net->rfkill->state = RFKILL_STATE_UNBLOCKED;
        hso_net->rfkill->data = hso_dev;
        hso_net->rfkill->toggle_radio = hso_radio_toggle;
        if (rfkill_register(hso_net->rfkill) < 0) {
index 164332cbb77c81e7623dc5c9c193739cd7f87313..e1ec7d9aa49cc81d6b09a28a30adc47edf5727e4 100644 (file)
@@ -52,14 +52,6 @@ enum rfkill_state {
        RFKILL_STATE_MAX,               /* marker for last valid state */
 };
 
-/*
- * These are DEPRECATED, drivers using them should be verified to
- * comply with the rfkill usage guidelines in Documentation/rfkill.txt
- * and then converted to use the new names for rfkill_state
- */
-#define RFKILL_STATE_OFF RFKILL_STATE_SOFT_BLOCKED
-#define RFKILL_STATE_ON  RFKILL_STATE_UNBLOCKED
-
 /**
  * struct rfkill - rfkill control structure.
  * @name: Name of the switch.
index 2b75aee042173b5edb5d13d12216180b67497688..870032faece25e39863ba13f6e9893da1f85a47a 100644 (file)
@@ -113,7 +113,7 @@ void wimax_report_rfkill_hw(struct wimax_dev *wimax_dev,
        if (state != wimax_dev->rf_hw) {
                wimax_dev->rf_hw = state;
                rfkill_state = state == WIMAX_RF_ON ?
-                       RFKILL_STATE_OFF : RFKILL_STATE_ON;
+                       RFKILL_STATE_UNBLOCKED : RFKILL_STATE_SOFT_BLOCKED;
                if (wimax_dev->rf_hw == WIMAX_RF_ON
                    && wimax_dev->rf_sw == WIMAX_RF_ON)
                        wimax_state = WIMAX_ST_READY;
@@ -259,10 +259,10 @@ int wimax_rfkill_toggle_radio(void *data, enum rfkill_state state)
 
        d_fnstart(3, dev, "(wimax_dev %p state %u)\n", wimax_dev, state);
        switch (state) {
-       case RFKILL_STATE_ON:
+       case RFKILL_STATE_SOFT_BLOCKED:
                rf_state = WIMAX_RF_OFF;
                break;
-       case RFKILL_STATE_OFF:
+       case RFKILL_STATE_UNBLOCKED:
                rf_state = WIMAX_RF_ON;
                break;
        default:
@@ -361,7 +361,7 @@ int wimax_rfkill_add(struct wimax_dev *wimax_dev)
        wimax_dev->rfkill = rfkill;
 
        rfkill->name = wimax_dev->name;
-       rfkill->state = RFKILL_STATE_OFF;
+       rfkill->state = RFKILL_STATE_UNBLOCKED;
        rfkill->data = wimax_dev;
        rfkill->toggle_radio = wimax_rfkill_toggle_radio;
        rfkill->user_claim_unsupported = 1;