From: Jonathan Cameron <jic23@kernel.org>
To: Cai Huoqing <caihuoqing@baidu.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>, <linux-iio@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] iio: st_lsm9ds0: Make use of the helper function dev_err_probe()
Date: Wed, 29 Sep 2021 18:06:38 +0100 [thread overview]
Message-ID: <20210929180638.6ddb313b@jic23-huawei> (raw)
In-Reply-To: <20210928014055.1431-2-caihuoqing@baidu.com>
On Tue, 28 Sep 2021 09:40:54 +0800
Cai Huoqing <caihuoqing@baidu.com> wrote:
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error, the benefit is that DEFER issue will be logged
> in the devices_deferred debugfs file.
> Using dev_err_probe() can reduce code size, and the error value
> gets printed.
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Hi Cai,
Picking a random patch to reply to...
Thanks for your hard work on these. The ones I haven't replied to look
fine to me. It might have been slightly better to slow down your initial
submission of these as then we could perhaps have avoided 2-3 versions
of every patch by identifying shared elements to improve in a smaller set.
Still that's the benefit of hindsight!
I'll not apply these quite yet so as to allow time for driver maintainers
and others to take a look.
If you could tidy up those few minor comments I have that would be great.
Thanks,
Jonathan
> ---
> drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
> index b3a43a3b04ff..9fb06b7cde3c 100644
> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
> @@ -24,10 +24,10 @@ static int st_lsm9ds0_power_enable(struct device *dev, struct st_lsm9ds0 *lsm9ds
>
> /* Regulators not mandatory, but if requested we should enable them. */
> lsm9ds0->vdd = devm_regulator_get(dev, "vdd");
> - if (IS_ERR(lsm9ds0->vdd)) {
> - dev_err(dev, "unable to get Vdd supply\n");
> - return PTR_ERR(lsm9ds0->vdd);
> - }
> + if (IS_ERR(lsm9ds0->vdd))
> + return dev_err_probe(dev, PTR_ERR(lsm9ds0->vdd),
> + "unable to get Vdd supply\n");
> +
> ret = regulator_enable(lsm9ds0->vdd);
> if (ret) {
> dev_warn(dev, "Failed to enable specified Vdd supply\n");
> @@ -36,9 +36,9 @@ static int st_lsm9ds0_power_enable(struct device *dev, struct st_lsm9ds0 *lsm9ds
>
> lsm9ds0->vdd_io = devm_regulator_get(dev, "vddio");
> if (IS_ERR(lsm9ds0->vdd_io)) {
> - dev_err(dev, "unable to get Vdd_IO supply\n");
> regulator_disable(lsm9ds0->vdd);
> - return PTR_ERR(lsm9ds0->vdd_io);
> + return dev_err_probe(dev, PTR_ERR(lsm9ds0->vdd_io),
> + "unable to get Vdd_IO supply\n");
> }
> ret = regulator_enable(lsm9ds0->vdd_io);
> if (ret) {
next prev parent reply other threads:[~2021-09-29 17:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 1:40 [PATCH v2 1/2] iio: st_sensors: Make use of the helper function dev_err_probe() Cai Huoqing
2021-09-28 1:40 ` [PATCH v2 2/2] iio: st_lsm9ds0: " Cai Huoqing
2021-09-29 17:06 ` Jonathan Cameron [this message]
2021-10-07 17:30 ` Jonathan Cameron
2021-10-07 17:30 ` Andy Shevchenko
2021-10-07 17:28 ` [PATCH v2 1/2] iio: st_sensors: " 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=20210929180638.6ddb313b@jic23-huawei \
--to=jic23@kernel.org \
--cc=caihuoqing@baidu.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.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