From: Michal Simek <michal.simek@amd.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
Linus Walleij <linus.walleij@linaro.org>,
Joel Stanley <joel@jms.id.au>,
Andrew Jeffery <andrew@codeconstruct.com.au>,
Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>,
Srinivas Neeli <srinivas.neeli@amd.com>,
Linus Walleij <linusw@kernel.org>,
Bartosz Golaszewski <brgl@kernel.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org
Subject: Re: [PATCH v2 3/3] gpio: zynq: Simplify with of_device_get_match_data()
Date: Fri, 19 Dec 2025 11:14:35 +0100 [thread overview]
Message-ID: <f9f3feec-2ed0-45c7-8467-2aea3222ffbc@amd.com> (raw)
In-Reply-To: <20251219-gpio-of-match-v2-3-5c65cbb513ac@oss.qualcomm.com>
On 12/19/25 11:11, Krzysztof Kozlowski wrote:
> Driver's probe function matches against driver's of_device_id table,
> where each entry has non-NULL match data, so of_match_node() can be
> simplified with of_device_get_match_data().
device_get_match_data() right?
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
> drivers/gpio/gpio-zynq.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
> index 97780c57ab56..d69773318888 100644
> --- a/drivers/gpio/gpio-zynq.c
> +++ b/drivers/gpio/gpio-zynq.c
> @@ -903,18 +903,16 @@ static int zynq_gpio_probe(struct platform_device *pdev)
> struct zynq_gpio *gpio;
> struct gpio_chip *chip;
> struct gpio_irq_chip *girq;
> - const struct of_device_id *match;
>
> gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
> if (!gpio)
> return -ENOMEM;
>
> - match = of_match_node(zynq_gpio_of_match, pdev->dev.of_node);
> - if (!match) {
> - dev_err(&pdev->dev, "of_match_node() failed\n");
> + gpio->p_data = device_get_match_data(&pdev->dev);
> + if (!gpio->p_data) {
> + dev_err(&pdev->dev, "of_device_get_match_data() failed\n");
device_get_match_data() ?
> return -EINVAL;
> }
> - gpio->p_data = match->data;
> platform_set_drvdata(pdev, gpio);
>
> gpio->base_addr = devm_platform_ioremap_resource(pdev, 0);
>
M
next prev parent reply other threads:[~2025-12-19 10:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 10:11 [PATCH v2 0/3] gpio: Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-12-19 10:11 ` [PATCH v2 1/3] gpio: aspeed: " Krzysztof Kozlowski
2026-01-01 22:35 ` Linus Walleij
2025-12-19 10:11 ` [PATCH v2 2/3] gpio: creg-snps: " Krzysztof Kozlowski
2026-01-01 22:35 ` Linus Walleij
2025-12-19 10:11 ` [PATCH v2 3/3] gpio: zynq: " Krzysztof Kozlowski
2025-12-19 10:14 ` Michal Simek [this message]
2025-12-19 10:15 ` Bartosz Golaszewski
2025-12-19 12:10 ` Krzysztof Kozlowski
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=f9f3feec-2ed0-45c7-8467-2aea3222ffbc@amd.com \
--to=michal.simek@amd.com \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=andrew@codeconstruct.com.au \
--cc=brgl@kernel.org \
--cc=joel@jms.id.au \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=linus.walleij@linaro.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shubhrajyoti.datta@amd.com \
--cc=srinivas.neeli@amd.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