From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Tian Tao <tiantao6@hisilicon.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Linux-OMAP <linux-omap@vger.kernel.org>,
linux-gpio <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v2] gpio: omap: Use device_get_match_data() helper
Date: Wed, 31 Mar 2021 20:38:24 +0200 [thread overview]
Message-ID: <CAMpxmJXxgh_YuHUmJUTBQJTYUdw54y2E+R+UxqsV56Ouj+eF3g@mail.gmail.com> (raw)
In-Reply-To: <1617178751-18937-1-git-send-email-tiantao6@hisilicon.com>
On Wed, Mar 31, 2021 at 10:18 AM Tian Tao <tiantao6@hisilicon.com> wrote:
>
> Use the device_get_match_data() helper instead of open coding.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
>
> v2: drop the space between ? and :.
> ---
> drivers/gpio/gpio-omap.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 41952bb..f4df555 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1364,15 +1364,14 @@ static int omap_gpio_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct device_node *node = dev->of_node;
> - const struct of_device_id *match;
> const struct omap_gpio_platform_data *pdata;
> struct gpio_bank *bank;
> struct irq_chip *irqc;
> int ret;
>
> - match = of_match_device(of_match_ptr(omap_gpio_match), dev);
> + pdata = device_get_match_data(dev);
>
> - pdata = match ? match->data : dev_get_platdata(dev);
> + pdata = pdata ?: dev_get_platdata(dev);
> if (!pdata)
> return -EINVAL;
>
> --
> 2.7.4
>
Applied, thanks!
Bartosz
prev parent reply other threads:[~2021-03-31 18:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 8:19 [PATCH v2] gpio: omap: Use device_get_match_data() helper Tian Tao
2021-03-31 18:38 ` Bartosz Golaszewski [this message]
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=CAMpxmJXxgh_YuHUmJUTBQJTYUdw54y2E+R+UxqsV56Ouj+eF3g@mail.gmail.com \
--to=bgolaszewski@baylibre.com \
--cc=grygorii.strashko@ti.com \
--cc=khilman@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=ssantosh@kernel.org \
--cc=tiantao6@hisilicon.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).