From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Rob Herring <robh@kernel.org>,
Avi Fishman <avifishman70@gmail.com>,
Tomer Maimon <tmaimon77@gmail.com>,
Tali Perry <tali.perry1@gmail.com>,
Patrick Venture <venture@google.com>,
Nancy Yuen <yuenn@google.com>,
Benjamin Fair <benjaminfair@google.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Cc: <openbmc@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RESEND PATCH] reset: Use device_get_match_data()
Date: Thu, 16 Nov 2023 10:51:57 +0100 [thread overview]
Message-ID: <6ef31fbd-4c90-45f5-83c0-9a41dfd2b59a@foss.st.com> (raw)
In-Reply-To: <20231115205848.3732609-1-robh@kernel.org>
On 11/15/23 21:58, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> drivers/reset/reset-npcm.c | 5 ++---
> drivers/reset/sti/reset-syscfg.c | 11 ++++++-----
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/reset/reset-npcm.c b/drivers/reset/reset-npcm.c
> index f6c4f854f2be..8935ef95a2d1 100644
> --- a/drivers/reset/reset-npcm.c
> +++ b/drivers/reset/reset-npcm.c
> @@ -6,8 +6,8 @@
> #include <linux/io.h>
> #include <linux/init.h>
> #include <linux/of.h>
> -#include <linux/of_device.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/reboot.h>
> #include <linux/reset-controller.h>
> #include <linux/spinlock.h>
> @@ -351,8 +351,7 @@ static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc)
> }
> }
>
> - rc->info = (const struct npcm_reset_info *)
> - of_match_device(dev->driver->of_match_table, dev)->data;
> + rc->info = device_get_match_data(dev);
> switch (rc->info->bmc_id) {
> case BMC_NPCM7XX:
> npcm_usb_reset_npcm7xx(rc);
> diff --git a/drivers/reset/sti/reset-syscfg.c b/drivers/reset/sti/reset-syscfg.c
> index c1ba04f6f155..2324060b747c 100644
> --- a/drivers/reset/sti/reset-syscfg.c
> +++ b/drivers/reset/sti/reset-syscfg.c
> @@ -7,10 +7,11 @@
> */
> #include <linux/kernel.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/module.h>
> #include <linux/err.h>
> #include <linux/types.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> #include <linux/regmap.h>
> #include <linux/mfd/syscon.h>
>
> @@ -183,14 +184,14 @@ static int syscfg_reset_controller_register(struct device *dev,
> int syscfg_reset_probe(struct platform_device *pdev)
> {
> struct device *dev = pdev ? &pdev->dev : NULL;
> - const struct of_device_id *match;
> + const void *data;
>
> if (!dev || !dev->driver)
> return -ENODEV;
>
> - match = of_match_device(dev->driver->of_match_table, dev);
> - if (!match || !match->data)
> + data = device_get_match_data(&pdev->dev);
> + if (!data)
> return -EINVAL;
>
> - return syscfg_reset_controller_register(dev, match->data);
> + return syscfg_reset_controller_register(dev, data);
> }
for drivers/reset/sti/reset-syscfg.c
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
next prev parent reply other threads:[~2023-11-16 9:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 20:58 [RESEND PATCH] reset: Use device_get_match_data() Rob Herring
2023-11-16 9:51 ` Patrice CHOTARD [this message]
2023-11-29 11:50 ` Philipp Zabel
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=6ef31fbd-4c90-45f5-83c0-9a41dfd2b59a@foss.st.com \
--to=patrice.chotard@foss.st.com \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=yuenn@google.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