From: David Lechner <dlechner@baylibre.com>
To: Jonathan Cameron <jic23@kernel.org>,
Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: robh@kernel.org, conor+dt@kernel.org, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pwm@vger.kernel.org
Subject: Re: [PATCH v9 8/8] iio: adc: ad4851: add ad485x driver
Date: Wed, 8 Jan 2025 11:06:09 -0600 [thread overview]
Message-ID: <b650f023-19f6-4f84-ae07-4383376268e6@baylibre.com> (raw)
In-Reply-To: <20241223120005.1bc9a208@jic23-huawei>
On 12/23/24 6:00 AM, Jonathan Cameron wrote:
> On Fri, 20 Dec 2024 14:01:34 +0200
> Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
>
...
>> + ret = devm_regulator_get_enable_optional(dev, "vddh");
>> + if (ret < 0 && ret != -ENODEV)
>> + return dev_err_probe(dev, ret, "failed to enable vddh voltage\n");
>> +
>> + ret = devm_regulator_get_enable_optional(dev, "vddl");
>> + if (ret < 0 && ret != -ENODEV)
>> + return dev_err_probe(dev, ret, "failed to enable vddl voltage\n");
>> +
>> + ret = devm_regulator_get_enable_optional(dev, "vrefbuf");
>> + if (ret < 0 && ret != -ENODEV)
>> + return dev_err_probe(dev, ret, "failed to enable vrefbuf voltage\n");
>> +
>> + if (ret > 0)
>
> I'm fairly sure that call never returns a positive. Will return 0 for success so I think this
> should be if (ret == 0)
Even better, make it 1 line instead of 4 and use the specific error code we are
checking for:
st->vrefbuf_en = ret != -ENODEV;
>
>> + st->vrefbuf_en = true;
>> + else
>> + st->vrefbuf_en = false;
>> +
>> + ret = devm_regulator_get_enable_optional(dev, "vrefio");
>> + if (ret < 0 && ret != -ENODEV)
>> + return dev_err_probe(dev, ret, "failed to enable vrefio voltage\n");
>> +
>> + if (ret > 0)
>
> Same here.
^
>
>> + st->vrefio_en = true;
>> + else
>> + st->vrefio_en = false;
>> +
> ...
>
>> +}
>
next prev parent reply other threads:[~2025-01-08 17:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 12:01 [PATCH v9 1/8] iio: backend: add API for interface get Antoniu Miclaus
2024-12-20 12:01 ` [PATCH v9 2/8] iio: backend: add support for data size set Antoniu Miclaus
2024-12-20 12:01 ` [PATCH v9 3/8] iio: backend: add API for oversampling Antoniu Miclaus
2024-12-20 12:01 ` [PATCH v9 4/8] iio: adc: adi-axi-adc: add interface type Antoniu Miclaus
2024-12-20 12:01 ` [PATCH v9 5/8] iio: adc: adi-axi-adc: set data format Antoniu Miclaus
2024-12-20 12:01 ` [PATCH v9 6/8] iio: adc: adi-axi-adc: add oversampling Antoniu Miclaus
2024-12-20 12:01 ` [PATCH v9 7/8] dt-bindings: iio: adc: add ad4851 Antoniu Miclaus
2024-12-23 11:40 ` Jonathan Cameron
2025-01-08 16:48 ` David Lechner
2024-12-20 12:01 ` [PATCH v9 8/8] iio: adc: ad4851: add ad485x driver Antoniu Miclaus
2024-12-23 12:00 ` Jonathan Cameron
2025-01-08 17:06 ` David Lechner [this message]
2025-01-08 23:24 ` David Lechner
2025-01-14 12:01 ` Miclaus, Antoniu
2025-01-14 13:20 ` Jonathan Cameron
2025-01-14 15:51 ` David Lechner
2025-01-17 9:59 ` Uwe Kleine-König
2025-01-17 15:43 ` Jonathan Cameron
2024-12-23 11:33 ` [PATCH v9 1/8] iio: backend: add API for interface get Jonathan Cameron
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=b650f023-19f6-4f84-ae07-4383376268e6@baylibre.com \
--to=dlechner@baylibre.com \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=robh@kernel.org \
/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