Search Linux Wireless

Re: [rt2x00-users] [PATCH v2 2/4] rt2800usb: remove rt2800usb_set_state function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 13, 2012 at 5:48 AM, Jakub Kicinski <kubakici@xxxxx> wrote:
> Remove rt2800usb_set_state to make the flow inside USB driver
> similar to that of PCI driver.
>
> Signed-off-by: Jakub Kicinski <kubakici@xxxxx>

The same comment with respect to falling through the state cases as
for patch 1 of the
series applies here.

> ---
>  drivers/net/wireless/rt2x00/rt2800usb.c |   28 +++++++++-------------------
>  1 files changed, 9 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
> index d009b6b..15cce5e 100644
> --- a/drivers/net/wireless/rt2x00/rt2800usb.c
> +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
> @@ -272,17 +272,6 @@ static void rt2800usb_disable_radio(struct rt2x00_dev *rt2x00dev)
>        rt2x00usb_disable_radio(rt2x00dev);
>  }
>
> -static int rt2800usb_set_state(struct rt2x00_dev *rt2x00dev,
> -                              enum dev_state state)
> -{
> -       if (state == STATE_AWAKE)
> -               rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 2);
> -       else
> -               rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0xff, 2);
> -
> -       return 0;
> -}
> -
>  static int rt2800usb_set_device_state(struct rt2x00_dev *rt2x00dev,
>                                      enum dev_state state)
>  {
> @@ -295,7 +284,7 @@ static int rt2800usb_set_device_state(struct rt2x00_dev *rt2x00dev,
>                 * to be woken up. After that it needs a bit of time
>                 * to be fully awake and then the radio can be enabled.
>                 */
> -               rt2800usb_set_state(rt2x00dev, STATE_AWAKE);
> +               rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 2);
>                msleep(1);
>                retval = rt2800usb_enable_radio(rt2x00dev);
>                break;
> @@ -305,17 +294,18 @@ static int rt2800usb_set_device_state(struct rt2x00_dev *rt2x00dev,
>                 * be put to sleep for powersaving.
>                 */
>                rt2800usb_disable_radio(rt2x00dev);
> -               rt2800usb_set_state(rt2x00dev, STATE_SLEEP);
> -               break;
> -       case STATE_RADIO_IRQ_ON:
> -       case STATE_RADIO_IRQ_OFF:
> -               /* No support, but no error either */
> -               break;
> +               /* fall through */
>        case STATE_DEEP_SLEEP:
>        case STATE_SLEEP:
>        case STATE_STANDBY:
> +               rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0xff, 2);
> +               break;
>        case STATE_AWAKE:
> -               retval = rt2800usb_set_state(rt2x00dev, state);
> +               rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 2);
> +               break;
> +       case STATE_RADIO_IRQ_ON:
> +       case STATE_RADIO_IRQ_OFF:
> +               /* No support, but no error either */
>                break;
>        default:
>                retval = -ENOTSUPP;

---
Gertjan
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux