Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cbf830e137d1b6057cb6b553a8ebbb7d1b9343f
Commit:     5cbf830e137d1b6057cb6b553a8ebbb7d1b9343f
Parent:     dd9fa2d21aebbb618318954867c5dfe3751328be
Author:     Ivo van Doorn <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 6 14:16:09 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:55:14 2007 -0700

    [PATCH] rt2x00: Pass dev_state to rt2x00lib_toggle_rx
    
    Directly pass a value from the enum dev_state with rt2x00lib_toggle_rx,
    this will save us a ? : statement, and it is clearer then passing a 1 0
    argument.
    
    Signed-off-by: Ivo van Doorn <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/rt2x00/rt2x00dev.c |   13 ++++++-------
 drivers/net/wireless/rt2x00/rt2x00lib.h |    2 +-
 drivers/net/wireless/rt2x00/rt2x00mac.c |    4 ++--
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c 
b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 6dc4f63..e141048 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -120,7 +120,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
        /*
         * Enable RX.
         */
-       rt2x00lib_toggle_rx(rt2x00dev, 1);
+       rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
 
        /*
         * Start the TX queues.
@@ -151,7 +151,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
        /*
         * Disable RX.
         */
-       rt2x00lib_toggle_rx(rt2x00dev, 0);
+       rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
 
        /*
         * Disable radio.
@@ -159,14 +159,12 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
        rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF);
 }
 
-void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int enable)
+void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state)
 {
-       enum dev_state state = enable ? STATE_RADIO_RX_ON : STATE_RADIO_RX_OFF;
-
        /*
         * When we are disabling the RX, we should also stop the link tuner.
         */
-       if (!enable)
+       if (state == STATE_RADIO_RX_OFF)
                rt2x00lib_stop_link_tuner(rt2x00dev);
 
        rt2x00dev->ops->lib->set_device_state(rt2x00dev, state);
@@ -174,7 +172,8 @@ void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int 
enable)
        /*
         * When we are enabling the RX, we should also start the link tuner.
         */
-       if (enable && is_interface_present(&rt2x00dev->interface))
+       if (state == STATE_RADIO_RX_ON &&
+           is_interface_present(&rt2x00dev->interface))
                rt2x00lib_start_link_tuner(rt2x00dev);
 }
 
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h 
b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 29ca932..298faa9 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -38,7 +38,7 @@
  */
 int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);
 void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev);
-void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int enable);
+void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state);
 void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev);
 
 /*
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c 
b/drivers/net/wireless/rt2x00/rt2x00mac.c
index e98d013..f519d73 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -272,7 +272,7 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct 
ieee80211_conf *conf)
                if (!conf->radio_enabled)
                        rt2x00lib_disable_radio(rt2x00dev);
                else
-                       rt2x00lib_toggle_rx(rt2x00dev, 0);
+                       rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
        }
 
        rt2x00lib_config(rt2x00dev, conf, 0);
@@ -281,7 +281,7 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct 
ieee80211_conf *conf)
         * Reenable RX only if the radio should be on.
         */
        if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
-               rt2x00lib_toggle_rx(rt2x00dev, 1);
+               rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
        else if (conf->radio_enabled)
                return rt2x00lib_enable_radio(rt2x00dev);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to