linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: Jakub Kicinski <kubakici@wp.pl>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	users@rt2x00.serialmonkey.com
Subject: Re: [rt2x00-users] [PATCH v2 2/4] rt2800usb: remove rt2800usb_set_state function
Date: Tue, 14 Feb 2012 11:48:50 +0100	[thread overview]
Message-ID: <CAL1gcdP2WaKm75rJn91zKpLiP=tNKxp8GWixn4Cqov-DWw6TOA@mail.gmail.com> (raw)
In-Reply-To: <1329108519-5342-3-git-send-email-kubakici@wp.pl>

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

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

  reply	other threads:[~2012-02-14 10:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13  4:48 [PATCH v2 0/4] rt2x00: Update MCU operations during device initialization Jakub Kicinski
2012-02-13  4:48 ` [PATCH v2 1/4] rt2800pci: remove rt2800pci_set_state function Jakub Kicinski
2012-02-14 10:47   ` [rt2x00-users] " Gertjan van Wingerde
2012-02-14 17:05     ` Jakub Kicinski
2012-02-15 15:42       ` Gertjan van Wingerde
2012-02-15 19:10         ` Jakub Kicinski
2012-02-13  4:48 ` [PATCH v2 2/4] rt2800usb: remove rt2800usb_set_state function Jakub Kicinski
2012-02-14 10:48   ` Gertjan van Wingerde [this message]
2012-02-13  4:48 ` [PATCH v2 3/4] rt2800: Add documentation on MCU requests Jakub Kicinski
2012-02-14 10:50   ` [rt2x00-users] " Gertjan van Wingerde
2012-02-13  4:48 ` [PATCH v2 4/4] rt2800pci: Fix 'Error - MCU request failed' during initialization Jakub Kicinski
2012-02-14 10:50   ` [rt2x00-users] " Gertjan van Wingerde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL1gcdP2WaKm75rJn91zKpLiP=tNKxp8GWixn4Cqov-DWw6TOA@mail.gmail.com' \
    --to=gwingerde@gmail.com \
    --cc=kubakici@wp.pl \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).