public inbox for linux-watchdog@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] watchdog: rzn1: Minor improvements
@ 2026-03-24 11:48 Herve Codina (Schneider Electric)
  2026-03-24 11:48 ` [PATCH v3 1/2] watchdog: rzn1: Fix reverse xmas tree declaration Herve Codina (Schneider Electric)
  2026-03-24 11:48 ` [PATCH v3 2/2] watchdog: rzn1: Use dev_err_probe() Herve Codina (Schneider Electric)
  0 siblings, 2 replies; 5+ messages in thread
From: Herve Codina (Schneider Electric) @ 2026-03-24 11:48 UTC (permalink / raw)
  To: Wolfram Sang, Geert Uytterhoeven, Wim Van Sebroeck, Guenter Roeck
  Cc: linux-renesas-soc, linux-watchdog, linux-kernel, Pascal Eberhard,
	Miquel Raynal, Thomas Petazzoni,
	Herve Codina (Schneider Electric)

Hi,

Patches present in this series are minor improvements of the RZ/N1
watchdog driver.

They were originally part of the series adding support for direct
hardware reset [0] but due to recent modification in this original
series, it no longer needs to have them part of it.

Extract them from the original series and leave them alone in this
current minor improvement series.

Consider this series a v3 iteration to keep consistency with the
original series where, in v2 iteration, some changes have been requested
on patch 2 and tags have been received. Those changes are handled here.

[0] https://lore.kernel.org/all/20260313092417.294356-1-herve.codina@bootlin.com/

Best regards,
Hervé

Changes v2 -> v3:
  v2: https://lore.kernel.org/all/20260313092417.294356-1-herve.codina@bootlin.com/

  - Patch 1
    Add 'Reviewed-by: Wolfram Sang'
    Add 'Tested-by: Wolfram Sang'

  - Patch 2
    Fix dev_err_probe() message.
    Add 'Reviewed-by: Wolfram Sang'
    Add 'Tested-by: Wolfram Sang'

Herve Codina (Schneider Electric) (2):
  watchdog: rzn1: Fix reverse xmas tree declaration
  watchdog: rzn1: Use dev_err_probe()

 drivers/watchdog/rzn1_wdt.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] watchdog: rzn1: Fix reverse xmas tree declaration
  2026-03-24 11:48 [PATCH v3 0/2] watchdog: rzn1: Minor improvements Herve Codina (Schneider Electric)
@ 2026-03-24 11:48 ` Herve Codina (Schneider Electric)
  2026-03-24 12:12   ` Guenter Roeck
  2026-03-24 11:48 ` [PATCH v3 2/2] watchdog: rzn1: Use dev_err_probe() Herve Codina (Schneider Electric)
  1 sibling, 1 reply; 5+ messages in thread
From: Herve Codina (Schneider Electric) @ 2026-03-24 11:48 UTC (permalink / raw)
  To: Wolfram Sang, Geert Uytterhoeven, Wim Van Sebroeck, Guenter Roeck
  Cc: linux-renesas-soc, linux-watchdog, linux-kernel, Pascal Eberhard,
	Miquel Raynal, Thomas Petazzoni,
	Herve Codina (Schneider Electric)

Variables declared in probe() don't follow the reverse xmas
tree convention.

Fix the declaration in order to follow the convention.

Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/watchdog/rzn1_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
index 96fd04fbc2a2..b7034eac91d0 100644
--- a/drivers/watchdog/rzn1_wdt.c
+++ b/drivers/watchdog/rzn1_wdt.c
@@ -101,10 +101,10 @@ static const struct watchdog_ops rzn1_wdt_ops = {
 static int rzn1_wdt_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct rzn1_watchdog *wdt;
 	struct device_node *np = dev->of_node;
-	struct clk *clk;
+	struct rzn1_watchdog *wdt;
 	unsigned long clk_rate;
+	struct clk *clk;
 	int ret;
 	int irq;
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] watchdog: rzn1: Use dev_err_probe()
  2026-03-24 11:48 [PATCH v3 0/2] watchdog: rzn1: Minor improvements Herve Codina (Schneider Electric)
  2026-03-24 11:48 ` [PATCH v3 1/2] watchdog: rzn1: Fix reverse xmas tree declaration Herve Codina (Schneider Electric)
@ 2026-03-24 11:48 ` Herve Codina (Schneider Electric)
  2026-03-24 12:13   ` Guenter Roeck
  1 sibling, 1 reply; 5+ messages in thread
From: Herve Codina (Schneider Electric) @ 2026-03-24 11:48 UTC (permalink / raw)
  To: Wolfram Sang, Geert Uytterhoeven, Wim Van Sebroeck, Guenter Roeck
  Cc: linux-renesas-soc, linux-watchdog, linux-kernel, Pascal Eberhard,
	Miquel Raynal, Thomas Petazzoni,
	Herve Codina (Schneider Electric)

In the probe() function the following pattern is present several times:
	if (err) {
		dev_err(dev, ...);
		return err;
	}

Replace them by dev_err_probe() calls.

Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/watchdog/rzn1_wdt.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
index b7034eac91d0..48d5afef62a5 100644
--- a/drivers/watchdog/rzn1_wdt.c
+++ b/drivers/watchdog/rzn1_wdt.c
@@ -122,22 +122,16 @@ static int rzn1_wdt_probe(struct platform_device *pdev)
 
 	ret = devm_request_irq(dev, irq, rzn1_wdt_irq, 0,
 			       np->name, wdt);
-	if (ret) {
-		dev_err(dev, "failed to request irq %d\n", irq);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
 
 	clk = devm_clk_get_enabled(dev, NULL);
-	if (IS_ERR(clk)) {
-		dev_err(dev, "failed to get the clock\n");
-		return PTR_ERR(clk);
-	}
+	if (IS_ERR(clk))
+		return dev_err_probe(dev, PTR_ERR(clk), "failed to get the clock\n");
 
 	clk_rate = clk_get_rate(clk);
-	if (!clk_rate) {
-		dev_err(dev, "failed to get the clock rate\n");
-		return -EINVAL;
-	}
+	if (!clk_rate)
+		return dev_err_probe(dev, -EINVAL, "failed to get the clock rate\n");
 
 	wdt->clk_rate_khz = clk_rate / 1000;
 	wdt->wdtdev.info = &rzn1_wdt_info;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] watchdog: rzn1: Fix reverse xmas tree declaration
  2026-03-24 11:48 ` [PATCH v3 1/2] watchdog: rzn1: Fix reverse xmas tree declaration Herve Codina (Schneider Electric)
@ 2026-03-24 12:12   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-03-24 12:12 UTC (permalink / raw)
  To: Herve Codina (Schneider Electric), Wolfram Sang,
	Geert Uytterhoeven, Wim Van Sebroeck
  Cc: linux-renesas-soc, linux-watchdog, linux-kernel, Pascal Eberhard,
	Miquel Raynal, Thomas Petazzoni

On 3/24/26 04:48, Herve Codina (Schneider Electric) wrote:
> Variables declared in probe() don't follow the reverse xmas
> tree convention.
> 
> Fix the declaration in order to follow the convention.
> 
> Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/rzn1_wdt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
> index 96fd04fbc2a2..b7034eac91d0 100644
> --- a/drivers/watchdog/rzn1_wdt.c
> +++ b/drivers/watchdog/rzn1_wdt.c
> @@ -101,10 +101,10 @@ static const struct watchdog_ops rzn1_wdt_ops = {
>   static int rzn1_wdt_probe(struct platform_device *pdev)
>   {
>   	struct device *dev = &pdev->dev;
> -	struct rzn1_watchdog *wdt;
>   	struct device_node *np = dev->of_node;
> -	struct clk *clk;
> +	struct rzn1_watchdog *wdt;
>   	unsigned long clk_rate;
> +	struct clk *clk;
>   	int ret;
>   	int irq;
>   


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] watchdog: rzn1: Use dev_err_probe()
  2026-03-24 11:48 ` [PATCH v3 2/2] watchdog: rzn1: Use dev_err_probe() Herve Codina (Schneider Electric)
@ 2026-03-24 12:13   ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-03-24 12:13 UTC (permalink / raw)
  To: Herve Codina (Schneider Electric), Wolfram Sang,
	Geert Uytterhoeven, Wim Van Sebroeck
  Cc: linux-renesas-soc, linux-watchdog, linux-kernel, Pascal Eberhard,
	Miquel Raynal, Thomas Petazzoni

On 3/24/26 04:48, Herve Codina (Schneider Electric) wrote:
> In the probe() function the following pattern is present several times:
> 	if (err) {
> 		dev_err(dev, ...);
> 		return err;
> 	}
> 
> Replace them by dev_err_probe() calls.
> 
> Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/rzn1_wdt.c | 18 ++++++------------
>   1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/watchdog/rzn1_wdt.c b/drivers/watchdog/rzn1_wdt.c
> index b7034eac91d0..48d5afef62a5 100644
> --- a/drivers/watchdog/rzn1_wdt.c
> +++ b/drivers/watchdog/rzn1_wdt.c
> @@ -122,22 +122,16 @@ static int rzn1_wdt_probe(struct platform_device *pdev)
>   
>   	ret = devm_request_irq(dev, irq, rzn1_wdt_irq, 0,
>   			       np->name, wdt);
> -	if (ret) {
> -		dev_err(dev, "failed to request irq %d\n", irq);
> -		return ret;
> -	}
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
>   
>   	clk = devm_clk_get_enabled(dev, NULL);
> -	if (IS_ERR(clk)) {
> -		dev_err(dev, "failed to get the clock\n");
> -		return PTR_ERR(clk);
> -	}
> +	if (IS_ERR(clk))
> +		return dev_err_probe(dev, PTR_ERR(clk), "failed to get the clock\n");
>   
>   	clk_rate = clk_get_rate(clk);
> -	if (!clk_rate) {
> -		dev_err(dev, "failed to get the clock rate\n");
> -		return -EINVAL;
> -	}
> +	if (!clk_rate)
> +		return dev_err_probe(dev, -EINVAL, "failed to get the clock rate\n");
>   
>   	wdt->clk_rate_khz = clk_rate / 1000;
>   	wdt->wdtdev.info = &rzn1_wdt_info;


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-24 12:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 11:48 [PATCH v3 0/2] watchdog: rzn1: Minor improvements Herve Codina (Schneider Electric)
2026-03-24 11:48 ` [PATCH v3 1/2] watchdog: rzn1: Fix reverse xmas tree declaration Herve Codina (Schneider Electric)
2026-03-24 12:12   ` Guenter Roeck
2026-03-24 11:48 ` [PATCH v3 2/2] watchdog: rzn1: Use dev_err_probe() Herve Codina (Schneider Electric)
2026-03-24 12:13   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox