Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473584 > unrolled thread

Re: [PATCH v8 08/11] power: act8945a_charger: Add max current property

Started bySebastian Reichel <sre@kernel.org>
First post2016-08-31 17:00 +0200
Last post2016-08-31 17:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v8 08/11] power: act8945a_charger: Add max current  property Sebastian Reichel <sre@kernel.org> - 2016-08-31 17:00 +0200

#1473584 — Re: [PATCH v8 08/11] power: act8945a_charger: Add max current property

FromSebastian Reichel <sre@kernel.org>
Date2016-08-31 17:00 +0200
SubjectRe: [PATCH v8 08/11] power: act8945a_charger: Add max current property
Message-ID<scf9E-3I8-31@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web