linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Toke Høiland-Jørgensen" <toke@toke.dk>,
	"Kalle Valo" <kvalo@kernel.org>,
	"Arend van Spriel" <aspriel@gmail.com>,
	"Franky Lin" <franky.lin@broadcom.com>,
	"Hante Meuleman" <hante.meuleman@broadcom.com>,
	"Lee Jones" <lee@kernel.org>,
	"Brian Norris" <briannorris@chromium.org>,
	"Srinivasan Raju" <srini.raju@purelifi.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com
Subject: Re: [PATCH 1/6] wifi: ath9k: Obtain system GPIOS from descriptors
Date: Thu, 1 Feb 2024 15:17:51 +0200	[thread overview]
Message-ID: <ZbuZ_55a-qqDqkeN@smile.fi.intel.com> (raw)
In-Reply-To: <613ae419-9a2c-477e-8b19-8a29d42a3164@app.fastmail.com>

On Thu, Feb 01, 2024 at 01:20:16PM +0100, Arnd Bergmann wrote:
> On Wed, Jan 31, 2024, at 23:37, Linus Walleij wrote:


FWIW, some nit-picks below.

...

> -	if (ah->led_pin < 0) {
> +	if (AR_SREV_SOC(ah)) {
> +		ah->led_gpio = gpiod_get(ah->dev, "led", 0);
> +		if (IS_ERR(ah->led_gpio))
> +			ah->led_gpio = NULL;

Slightly better to have something like

		desc = gpiod_get_optional();
		if (!IS_ERR(desc))
			led_gpio = desc;


> +	} else if (ah->led_pin < 0) {

...

> +	if (sc->sc_ah->led_gpio)

Dup check

> +		gpiod_put(sc->sc_ah->led_gpio);

...

>  #include "htc.h"
> +#include <linux/gpio/consumer.h>

First to include linux/* ones?

...

> +		ath9k_hw_set_gpio(priv->ah, priv->ah->led_pin,
> +				  (priv->brightness == LED_OFF));

Unnecessary parentheses.

>  }

...

> +	if (AR_SREV_SOC(priv->ah)) {
> +		priv->ah->led_gpio = gpiod_get(priv->ah->dev, "led", 0);
> +		if (IS_ERR(priv->ah->led_gpio))
> +			priv->ah->led_gpio = NULL;

_optional() ?


> +	} else if (AR_SREV_9287(priv->ah))

...

> +	if (ah->led_gpio)

Dup check.

> +		gpiod_set_value(ah->led_gpio, 1);
>  

...

> +	if (ah->led_gpio)

Ditto.

> +		gpiod_set_value(ah->led_gpio, 0);

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-02-01 13:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 22:37 [PATCH 0/6] Convert some wireless drivers to use GPIO descriptors Linus Walleij
2024-01-31 22:37 ` [PATCH 1/6] wifi: ath9k: Obtain system GPIOS from descriptors Linus Walleij
2024-02-01 10:57   ` Toke Høiland-Jørgensen
2024-02-01 11:40   ` Andy Shevchenko
2024-02-01 12:51     ` Kalle Valo
2024-02-01 12:20   ` Arnd Bergmann
2024-02-01 13:17     ` Andy Shevchenko [this message]
2024-02-01 14:00       ` Arnd Bergmann
2024-02-01 14:18         ` Toke Høiland-Jørgensen
2024-02-02  7:31           ` Arnd Bergmann
2024-02-02 10:23             ` Toke Høiland-Jørgensen
2024-02-05 18:13   ` Kalle Valo
2024-01-31 22:37 ` [PATCH 2/6] wifi: ti: wlcore: sdio: Drop unused include Linus Walleij
2024-02-05 18:17   ` Kalle Valo
2024-01-31 22:37 ` [PATCH 3/6] brcm80211: brcmsmac: Drop legacy header Linus Walleij
2024-01-31 22:37 ` [PATCH 4/6] wifi: mwifiex: Drop unused headers Linus Walleij
2024-01-31 22:37 ` [PATCH 5/6] wifi: plfxlc: Drop unused include Linus Walleij
2024-01-31 22:37 ` [PATCH 6/6] wifi: cw1200: Convert to GPIO descriptors Linus Walleij
2024-02-01 10:02   ` Kalle Valo
2024-02-01 11:42 ` [PATCH 0/6] Convert some wireless drivers to use " Andy Shevchenko
2024-02-01 12:53   ` Kalle Valo
2024-02-01 17:13     ` Linus Walleij

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=ZbuZ_55a-qqDqkeN@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=aspriel@gmail.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=briannorris@chromium.org \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@kernel.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=srini.raju@purelifi.com \
    --cc=toke@toke.dk \
    /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).