watchdog: rzn1: Minor improvements
v3 cover watchdog: rzn1: Minor improvements
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/[email protected]/
Best regards,
Hervé
Changes v2 -> v3:
v2: https://lore.kernel.org/all/[email protected]/
- 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(-)
Signature · 1 line
2.53.0
PATCH v3 1/2 watchdog: rzn1: Fix reverse xmas tree declaration
Variables declared in probe() don't follow the reverse xmas tree convention.
Fix the declaration in order to follow the convention.
--- drivers/watchdog/rzn1_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/watchdog/rzn1_wdt.c +2 -2
@@ -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;
Signature · 1 line
2.53.0
Re: [PATCH v3 1/2] watchdog: rzn1: Fix reverse xmas tree declaration
Quoted 8 lines · 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) <[email protected]>Reviewed-by Wolfram Sang <[email protected]>Tested-by Wolfram Sang <[email protected]>
Quoted 21 lines
--- drivers/watchdog/rzn1_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/watchdog/rzn1_wdt.c +2
-2@@ -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;
PATCH v3 2/2 watchdog: rzn1: Use dev_err_probe()
In reply to 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.
--- drivers/watchdog/rzn1_wdt.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/watchdog/rzn1_wdt.c +6 -12
@@ -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;
Signature · 1 line
2.53.0
Re: [PATCH v3 2/2] watchdog: rzn1: Use dev_err_probe()
Quoted 11 lines · 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) <[email protected]>Reviewed-by Wolfram Sang <[email protected]>Tested-by Wolfram Sang <[email protected]>
Quoted 37 lines
--- drivers/watchdog/rzn1_wdt.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)drivers/watchdog/rzn1_wdt.c +6
-12@@ -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;