lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbuZ_55a-qqDqkeN@smile.fi.intel.com>
Date: Thu, 1 Feb 2024 15:17:51 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Linus Walleij <linus.walleij@...aro.org>,
	Toke Høiland-Jørgensen <toke@...e.dk>,
	Kalle Valo <kvalo@...nel.org>, Arend van Spriel <aspriel@...il.com>,
	Franky Lin <franky.lin@...adcom.com>,
	Hante Meuleman <hante.meuleman@...adcom.com>,
	Lee Jones <lee@...nel.org>, Brian Norris <briannorris@...omium.org>,
	Srinivasan Raju <srini.raju@...elifi.com>,
	linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
	brcm80211-dev-list.pdl@...adcom.com
Subject: Re: [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



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ