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]
Date:   Wed, 31 Aug 2016 16:56:23 +0200
From:   Sebastian Reichel <sre@...nel.org>
To:     Wenyou Yang <wenyou.yang@...el.com>
Cc:     Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
        David Woodhouse <dwmw2@...radead.org>,
        Rob Herring <robh+dt@...nel.org>,
        Pawel Moll <pawel.moll@....com>,
        Mark Brown <broonie@...nel.org>,
        Ian Campbell <ijc+devicetree@...lion.org.uk>,
        Kumar Gala <galak@...eaurora.org>,
        Lee Jones <lee.jones@...aro.org>,
        Nicolas Ferre <nicolas.ferre@...el.com>,
        Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v8 07/11] power: act8945a_charger: Add capacity level
 property

Hi,

On Thu, Aug 25, 2016 at 03:19:55PM +0800, Wenyou Yang wrote:
> Add the power supply capacity level property, it corresponds to
> POWER_SUPPLY_CAPACITY_LEVEL_*.
> 
> It also utilizes the precision voltage detector function module
> to catch the low battery voltage.

[...]

> diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
> index 76806a0..a983de2 100644
> --- a/drivers/power/supply/Kconfig
> +++ b/drivers/power/supply/Kconfig
> @@ -77,7 +77,7 @@ config BATTERY_88PM860X
>  
>  config BATTERY_ACT8945A
>  	tristate "Active-semi ACT8945A charger driver"
> -	depends on MFD_ACT8945A || COMPILE_TEST
> +	depends on MFD_ACT8945A || GPIOLIB || COMPILE_TEST

This looks wrong. You probably wanted (MFD_ACT8945A && GPIOLIB).
But since the gpio consumer headers defines stubs for the !GPIOLIB
case just drop the dependency.

>  	help
>  	  Say Y here to enable support for power supply provided by
>  	  Active-semi ActivePath ACT8945A charger.

[...]

> +	charger->lbo_gpio = devm_gpiod_get(dev, "active-semi,lbo", GPIOD_IN);
> +	if (PTR_ERR(charger->lbo_gpio) == -EPROBE_DEFER) {
> +		dev_info(dev, "probe retry requested for gpio \"lbo\"\n");
> +		return -EPROBE_DEFER;
> +	} else if (IS_ERR(charger->lbo_gpio)) {
> +		dev_err(dev, "unable to claim gpio \"lbo\"\n");
> +		charger->lbo_gpio = NULL;
> +	}

Please use devm_gpiod_get_optional():

charger->lbo_gpio = devm_gpiod_get_optional(dev, "active-semi,lbo", GPIOD_IN);
if (IS_ERR(charger->lbo_gpio)) {
    err = PTR_ERR(charger->lbo_gpio)
    dev_err(dev, "unable to claim gpio \"lbo\": %ld\n", err);
    return err;
}

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ