lkml.org 
[lkml]   [2016]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 08/11] power: act8945a_charger: Add max current property
Hi,

On Thu, Aug 25, 2016 at 03:19:56PM +0800, Wenyou Yang wrote:
> Add the power supply's current max property,
> POWER_SUPPLY_PROP_CURRENT_MAX.

[...]

> - chglev_pin = of_get_named_gpio_flags(np,
> - "active-semi,chglev-gpios", 0, &flags);
> -
> - if (gpio_is_valid(chglev_pin)) {
> - gpio_set_value(chglev_pin,
> - ((flags == OF_GPIO_ACTIVE_LOW) ? 0 : 1));
> + charger->chglev_gpio = devm_gpiod_get(dev,
> + "active-semi,chglev", GPIOD_IN);
> + if (PTR_ERR(charger->chglev_gpio) == -EPROBE_DEFER) {
> + dev_info(dev, "probe retry requested for gpio \"chglev\"\n");
> + return -EPROBE_DEFER;
> + } else if (IS_ERR(charger->chglev_gpio)) {
> + dev_err(dev, "unable to claim gpio \"chglev\"\n");
> + charger->chglev_gpio = NULL;

Please also use devm_gpiod_get_optional() here (see previous patch).

-- Sebastian
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-09-17 09:58    [W:2.429 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site