lkml.org 
[lkml]   [2020]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 1/2] iio: adc: ad7291: convert to device tree
On Tue, Mar 17, 2020 at 4:53 PM Michael Auchter <michael.auchter@ni.com> wrote:
>
> There are no in-tree users of the platform data for this driver, so
> remove it and convert the driver to use device tree instead.

...

> + chip->reg = devm_regulator_get_optional(&client->dev, "vref");
> + if (!IS_ERR(chip->reg)) {

Why not to go with usual positive conditional?

> + ret = regulator_enable(chip->reg);
> + if (ret)
> + return ret;
> +
> chip->command |= AD7291_EXT_REF;
> + } else {
> + if (PTR_ERR(chip->reg) != -ENODEV)
> + return PTR_ERR(chip->reg);
> +
> + chip->reg = NULL;
> + }

...

> +static const struct of_device_id ad7291_of_match[] = {
> + { .compatible = "adi,ad7291", },

> + {},

No need for comma.

> +};

...

> + .of_match_table = of_match_ptr(ad7291_of_match),

No need to use of_match_ptr(). Haven't you got a compiler warning in !OF case?

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-03-22 00:47    [W:0.095 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site