mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Rob Herring <robh@kernel.org>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-watchdog@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] watchdog: st_lpc: Use device_get_match_data()
Date: Tue, 10 Oct 2023 08:29:10 +0200	[thread overview]
Message-ID: <f7b1dfe5-5efd-54d8-b651-b1fd5c2ab291@foss.st.com> (raw)
In-Reply-To: <20231009211356.3242037-18-robh@kernel.org>



On 10/9/23 23:13, 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/watchdog/st_lpc_wdt.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c
> index d2aa43c00221..4c5b8d98a4f3 100644
> --- a/drivers/watchdog/st_lpc_wdt.c
> +++ b/drivers/watchdog/st_lpc_wdt.c
> @@ -15,7 +15,6 @@
>  #include <linux/mfd/syscon.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_platform.h>
>  #include <linux/platform_device.h>
>  #include <linux/regmap.h>
>  #include <linux/watchdog.h>
> @@ -42,7 +41,7 @@ struct st_wdog {
>  	void __iomem *base;
>  	struct device *dev;
>  	struct regmap *regmap;
> -	struct st_wdog_syscfg *syscfg;
> +	const struct st_wdog_syscfg *syscfg;
>  	struct clk *clk;
>  	unsigned long clkrate;
>  	bool warm_reset;
> @@ -150,7 +149,6 @@ static void st_clk_disable_unprepare(void *data)
>  static int st_wdog_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> -	const struct of_device_id *match;
>  	struct device_node *np = dev->of_node;
>  	struct st_wdog *st_wdog;
>  	struct regmap *regmap;
> @@ -173,12 +171,7 @@ static int st_wdog_probe(struct platform_device *pdev)
>  	if (!st_wdog)
>  		return -ENOMEM;
>  
> -	match = of_match_device(st_wdog_match, dev);
> -	if (!match) {
> -		dev_err(dev, "Couldn't match device\n");
> -		return -ENODEV;
> -	}
> -	st_wdog->syscfg	= (struct st_wdog_syscfg *)match->data;
> +	st_wdog->syscfg	= (struct st_wdog_syscfg *)device_get_match_data(dev);
>  
>  	base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(base))

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

  reply	other threads:[~2023-10-10  6:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 21:13 Rob Herring
2023-10-10  6:29 ` Patrice CHOTARD [this message]
2023-10-10 13:35 ` Guenter Roeck

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=f7b1dfe5-5efd-54d8-b651-b1fd5c2ab291@foss.st.com \
    --to=patrice.chotard@foss.st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    --cc=wim@linux-watchdog.org \
    /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

all inboxes | Powered by JetHome®