From: Andy Shevchenko <andy@kernel.org>
To: "Duje Mihanović" <duje.mihanovic@skole.hr>
Cc: Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Russell King <linux@armlinux.org.uk>,
Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-gpio@vger.kernel.org
Subject: Re: [PATCH RFC v2 3/6] ARM: pxa: Convert Spitz CF power control to GPIO descriptors
Date: Wed, 27 Sep 2023 16:46:44 +0300 [thread overview]
Message-ID: <ZRQyREMrfCaDMnI0@smile.fi.intel.com> (raw)
In-Reply-To: <5984688.lOV4Wx5bFT@radijator>
On Wed, Sep 27, 2023 at 02:56:07PM +0200, Duje Mihanović wrote:
> On Tuesday, September 26, 2023 6:15:37 PM CEST Andy Shevchenko wrote:
> > On Tue, Sep 26, 2023 at 05:46:24PM +0200, Duje Mihanović wrote:
...
> > > + cf_power = gpiod_get(&pxa_device_mci.dev, "cf_power", GPIOD_ASIS);
> > > + if (IS_ERR(cf_power)) {
> > > + dev_err(&pxa_device_mci.dev,
> > > + "failed to get power control GPIO with
> %ld\n",
> > > + PTR_ERR(cf_power));
> > > + return;
> > > + }
> > >
> > > + gpiod_put(cf_power);
> >
> > Don't you want to use guarded gpiod_get()?
> > Okay, it seems not yet in the pending list, but we can survive without that.
>
> Can you please elaborate? If I understand correctly, the if statement right
> after gpiod_get is a guard.
It's about RAII version of the gpiod_get(). It's quite a new thing
in the Linux kernel.
--
With Best Regards,
Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andy@kernel.org>
To: "Duje Mihanović" <duje.mihanovic@skole.hr>
Cc: Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Russell King <linux@armlinux.org.uk>,
Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-gpio@vger.kernel.org
Subject: Re: [PATCH RFC v2 3/6] ARM: pxa: Convert Spitz CF power control to GPIO descriptors
Date: Wed, 27 Sep 2023 16:46:44 +0300 [thread overview]
Message-ID: <ZRQyREMrfCaDMnI0@smile.fi.intel.com> (raw)
In-Reply-To: <5984688.lOV4Wx5bFT@radijator>
On Wed, Sep 27, 2023 at 02:56:07PM +0200, Duje Mihanović wrote:
> On Tuesday, September 26, 2023 6:15:37 PM CEST Andy Shevchenko wrote:
> > On Tue, Sep 26, 2023 at 05:46:24PM +0200, Duje Mihanović wrote:
...
> > > + cf_power = gpiod_get(&pxa_device_mci.dev, "cf_power", GPIOD_ASIS);
> > > + if (IS_ERR(cf_power)) {
> > > + dev_err(&pxa_device_mci.dev,
> > > + "failed to get power control GPIO with
> %ld\n",
> > > + PTR_ERR(cf_power));
> > > + return;
> > > + }
> > >
> > > + gpiod_put(cf_power);
> >
> > Don't you want to use guarded gpiod_get()?
> > Okay, it seems not yet in the pending list, but we can survive without that.
>
> Can you please elaborate? If I understand correctly, the if statement right
> after gpiod_get is a guard.
It's about RAII version of the gpiod_get(). It's quite a new thing
in the Linux kernel.
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-09-27 13:46 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 15:46 [PATCH RFC v2 0/6] ARM: pxa: GPIO descriptor conversions Duje Mihanović
2023-09-26 15:46 ` [PATCH RFC v2 1/6] ARM: pxa: Convert Spitz OHCI to GPIO descriptors Duje Mihanović
2023-09-26 16:09 ` Andy Shevchenko
2023-09-26 16:09 ` Andy Shevchenko
2023-09-26 15:46 ` [PATCH RFC v2 2/6] ARM: pxa: Convert Spitz LEDs " Duje Mihanović
2023-09-26 20:21 ` Linus Walleij
2023-09-26 20:21 ` Linus Walleij
2023-09-26 15:46 ` [PATCH RFC v2 3/6] ARM: pxa: Convert Spitz CF power control " Duje Mihanović
2023-09-26 15:46 ` Duje Mihanović
2023-09-26 16:15 ` Andy Shevchenko
2023-09-26 16:15 ` Andy Shevchenko
2023-09-27 12:56 ` Duje Mihanović
2023-09-27 12:56 ` Duje Mihanović
2023-09-27 13:46 ` Andy Shevchenko [this message]
2023-09-27 13:46 ` Andy Shevchenko
2023-09-26 20:26 ` Linus Walleij
2023-09-26 20:26 ` Linus Walleij
2023-09-26 15:46 ` [PATCH RFC v2 4/6] ARM: pxa: Convert reset driver " Duje Mihanović
2023-09-26 16:17 ` Andy Shevchenko
2023-09-26 16:17 ` Andy Shevchenko
2023-09-26 20:26 ` Linus Walleij
2023-09-26 20:26 ` Linus Walleij
2023-09-26 15:46 ` [PATCH RFC v2 5/6] ARM: pxa: Convert Spitz hsync " Duje Mihanović
2023-09-26 16:19 ` Andy Shevchenko
2023-09-26 16:19 ` Andy Shevchenko
2023-09-27 12:54 ` Duje Mihanović
2023-09-27 12:54 ` Duje Mihanović
2023-09-26 15:46 ` [PATCH RFC v2 6/6] ARM: pxa: Convert gumstix Bluetooth " Duje Mihanović
2023-09-26 15:46 ` Duje Mihanović
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=ZRQyREMrfCaDMnI0@smile.fi.intel.com \
--to=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=daniel@zonque.org \
--cc=duje.mihanovic@skole.hr \
--cc=gregkh@linuxfoundation.org \
--cc=haojian.zhuang@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=robert.jarzmik@free.fr \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.