lkml.org 
[lkml]   [2024]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] wifi: ath9k: Obtain system GPIOS from descriptors
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



\
 
 \ /
  Last update: 2024-05-27 14:44    [W:0.074 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site