From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Michael Auchter <michael.auchter@ni.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>,
Stefan Popa <stefan.popa@analog.com>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] iio: adc: ad7291: convert to device tree
Date: Sun, 22 Mar 2020 01:46:21 +0200 [thread overview]
Message-ID: <CAHp75Veh3QRfqVFOpYbuuxcPqirc1_YrF-iZfRjNsYk7DWqYpQ@mail.gmail.com> (raw)
In-Reply-To: <20200317145113.12413-1-michael.auchter@ni.com>
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
next prev parent reply other threads:[~2020-03-21 23:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-17 13:56 [PATCH 1/2] iio: adc: ad7291: convert to device tree Michael Auchter
2020-03-17 13:56 ` [PATCH 2/2] dt-bindings: iio: adc: ad7291: add binding Michael Auchter
2020-03-17 14:16 ` [PATCH 1/2] iio: adc: ad7291: convert to device tree Lars-Peter Clausen
2020-03-17 14:51 ` [PATCH v2 " Michael Auchter
2020-03-17 14:51 ` [PATCH v2 2/2] dt-bindings: iio: adc: ad7291: add binding Michael Auchter
2020-03-30 21:16 ` Rob Herring
2020-03-17 16:13 ` [PATCH v2 1/2] iio: adc: ad7291: convert to device tree Lars-Peter Clausen
2020-03-21 23:46 ` Andy Shevchenko [this message]
2020-03-30 20:12 ` Michael Auchter
2020-03-31 10:56 ` Andy Shevchenko
2020-03-31 11:10 ` Ardelean, Alexandru
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHp75Veh3QRfqVFOpYbuuxcPqirc1_YrF-iZfRjNsYk7DWqYpQ@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=broonie@kernel.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.auchter@ni.com \
--cc=pmeerw@pmeerw.net \
--cc=stefan.popa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).