From: Sean Young <sean@mess.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-media@vger.kernel.org, mchehab@kernel.org,
hverkuil-cisco@xs4all.nl, pavel@ucw.cz,
sakari.ailus@linux.intel.com, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH -next 10/13] media: rc: gpio-ir-recv: Switch to use dev_err_probe() helper
Date: Fri, 16 Sep 2022 10:46:16 +0100 [thread overview]
Message-ID: <YyRF6ETUrJRUsVC7@gofer.mess.org> (raw)
In-Reply-To: <a56a9638-5a1f-4cbe-cf30-baae03b104c3@huawei.com>
Hi,
On Fri, Sep 16, 2022 at 09:13:14AM +0800, Yang Yingliang wrote:
> On 2022/9/16 0:38, Sean Young wrote:
> > On Thu, Sep 15, 2022 at 11:03:21PM +0800, Yang Yingliang wrote:
> > > In the probe path, dev_err() can be replace with dev_err_probe()
> > > which will check if error code is -EPROBE_DEFER.
> > >
> > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> > > ---
> > > drivers/media/rc/gpio-ir-recv.c | 10 +++-------
> > > 1 file changed, 3 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
> > > index 22e524b69806..8f1fff7af6c9 100644
> > > --- a/drivers/media/rc/gpio-ir-recv.c
> > > +++ b/drivers/media/rc/gpio-ir-recv.c
> > > @@ -74,13 +74,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
> > > return -ENOMEM;
> > > gpio_dev->gpiod = devm_gpiod_get(dev, NULL, GPIOD_IN);
> > > - if (IS_ERR(gpio_dev->gpiod)) {
> > > - rc = PTR_ERR(gpio_dev->gpiod);
> > > - /* Just try again if this happens */
> > > - if (rc != -EPROBE_DEFER)
> > > - dev_err(dev, "error getting gpio (%d)\n", rc);
> > > - return rc;
> > > - }
> > > + if (IS_ERR(gpio_dev->gpiod))
> > > + return dev_err_probe(dev, PTR_ERR(gpio_dev->gpiod),
> > > + "error getting gpio\n");
> > Now the error number is no longer logged. That can't be good?
> Instead of error number, the error name is printed in dev_err_probe(), and
> it's better for read.
Yes, I should have checked this. This is much nicer, with the error printed with
%pe. Thanks!
For the three drivers in drivers/media/rc/ :
Reviewed-by: Sean Young <sean@mess.org>
Thanks
Sean
next prev parent reply other threads:[~2022-09-16 9:46 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 15:03 [PATCH -next 00/13] media: Switch to use dev_err_probe() helper Yang Yingliang
2022-09-15 15:03 ` [PATCH -next 01/13] media: platform: stm32-cec: " Yang Yingliang
2022-09-19 14:32 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 02/13] media: i2c: ad5820: " Yang Yingliang
2022-09-19 14:37 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 03/13] media: i2c: imx274: " Yang Yingliang
2022-09-19 14:07 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 04/13] media: i2c: tc358743: " Yang Yingliang
2022-09-19 14:30 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 05/13] media: platform: mtk_mdp_comp: " Yang Yingliang
2022-09-19 14:40 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 06/13] media: platform: exynos4-is: " Yang Yingliang
2022-09-19 14:28 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 07/13] media: stm32-dcmi: " Yang Yingliang
2022-09-19 14:23 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 08/13] media: omap3isp: " Yang Yingliang
2022-09-19 14:05 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 09/13] media: xilinx: csi2rxss: " Yang Yingliang
2022-09-19 13:58 ` Laurent Pinchart
2022-09-19 14:07 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 10/13] media: rc: gpio-ir-recv: " Yang Yingliang
2022-09-15 16:38 ` Sean Young
2022-09-16 1:13 ` Yang Yingliang
2022-09-16 9:46 ` Sean Young [this message]
2022-09-15 15:03 ` [PATCH -next 11/13] media: rc: gpio-ir-tx: " Yang Yingliang
2022-09-19 14:22 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 12/13] media: rc: ir-rx51: " Yang Yingliang
2022-09-19 14:36 ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 13/13] media: uvcvideo: " Yang Yingliang
2022-09-18 13:16 ` Ricardo Ribalda
2022-09-19 13:59 ` Laurent Pinchart
2022-09-19 14:42 ` [PATCH -next 00/13] media: " Laurent Pinchart
2022-09-19 15:30 ` Yang Yingliang
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=YyRF6ETUrJRUsVC7@gofer.mess.org \
--to=sean@mess.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pavel@ucw.cz \
--cc=sakari.ailus@linux.intel.com \
--cc=yangyingliang@huawei.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).