lkml.org 
[lkml]   [2016]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface
On Thu, Apr 28, 2016 at 01:55:35PM +0800, Lu Baolu wrote:

> How about below code?

> + gpiod = gpiod_get(dev, "vbus_en", GPIOD_ASIS);
> + if (IS_ERR(gpiod))
> + return PTR_ERR(gpiod);
> +
> + config->gpio = desc_to_gpio(gpiod);
> + config->enable_high = device_property_read_bool(dev,
> + "enable-active-high");
> + gpiod_put(gpiod);


That looks reasonable, though if you use "gpio" as the name like DT you
could keep the code the same which would be even better? Not super
crticial though.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-04-28 19:41    [W:0.107 / U:3.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site