* [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe()
@ 2020-09-01 15:31 Krzysztof Kozlowski
2020-09-01 15:31 ` [PATCH 2/3] watchdog: davinci: " Krzysztof Kozlowski
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:31 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/watchdog/cadence_wdt.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 672b184da875..bc99e9164930 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -334,12 +334,9 @@ static int cdns_wdt_probe(struct platform_device *pdev)
watchdog_set_drvdata(cdns_wdt_device, wdt);
wdt->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(wdt->clk)) {
- ret = PTR_ERR(wdt->clk);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "input clock not found\n");
- return ret;
- }
+ if (IS_ERR(wdt->clk))
+ return dev_err_probe(dev, PTR_ERR(wdt->clk),
+ "input clock not found\n");
ret = clk_prepare_enable(wdt->clk);
if (ret) {
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] watchdog: davinci: Simplify with dev_err_probe()
2020-09-01 15:31 [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-09-01 15:31 ` Krzysztof Kozlowski
2020-09-01 15:50 ` Guenter Roeck
2020-09-01 20:19 ` Guenter Roeck
2020-09-01 15:31 ` [PATCH 3/3] watchdog: rti: " Krzysztof Kozlowski
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:31 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/watchdog/davinci_wdt.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
index 2b3f3cd382ef..e6eaba6bae5b 100644
--- a/drivers/watchdog/davinci_wdt.c
+++ b/drivers/watchdog/davinci_wdt.c
@@ -206,12 +206,9 @@ static int davinci_wdt_probe(struct platform_device *pdev)
return -ENOMEM;
davinci_wdt->clk = devm_clk_get(dev, NULL);
-
- if (IS_ERR(davinci_wdt->clk)) {
- if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER)
- dev_err(dev, "failed to get clock node\n");
- return PTR_ERR(davinci_wdt->clk);
- }
+ if (IS_ERR(davinci_wdt->clk))
+ return dev_err_probe(dev, PTR_ERR(davinci_wdt->clk),
+ "failed to get clock node\n");
ret = clk_prepare_enable(davinci_wdt->clk);
if (ret) {
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] watchdog: rti: Simplify with dev_err_probe()
2020-09-01 15:31 [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-01 15:31 ` [PATCH 2/3] watchdog: davinci: " Krzysztof Kozlowski
@ 2020-09-01 15:31 ` Krzysztof Kozlowski
2020-09-01 15:50 ` Guenter Roeck
2020-09-01 20:19 ` Guenter Roeck
2020-09-01 15:49 ` [PATCH 1/3] watchdog: cadence: " Guenter Roeck
2020-09-01 20:18 ` Guenter Roeck
3 siblings, 2 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-01 15:31 UTC (permalink / raw)
To: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel
Cc: Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
It is unusual to expect deferred probe from pm_runtime_get()...
---
drivers/watchdog/rti_wdt.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
index 705e8f7523e8..836319cbaca9 100644
--- a/drivers/watchdog/rti_wdt.c
+++ b/drivers/watchdog/rti_wdt.c
@@ -205,11 +205,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
return -ENOMEM;
clk = clk_get(dev, NULL);
- if (IS_ERR(clk)) {
- if (PTR_ERR(clk) != -EPROBE_DEFER)
- dev_err(dev, "failed to get clock\n");
- return PTR_ERR(clk);
- }
+ if (IS_ERR(clk))
+ return dev_err_probe(dev, PTR_ERR(clk), "failed to get clock\n");
wdt->freq = clk_get_rate(clk);
@@ -230,11 +227,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev);
- if (ret) {
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev, "runtime pm failed\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "runtime pm failed\n");
platform_set_drvdata(pdev, wdt);
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe()
2020-09-01 15:31 [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-01 15:31 ` [PATCH 2/3] watchdog: davinci: " Krzysztof Kozlowski
2020-09-01 15:31 ` [PATCH 3/3] watchdog: rti: " Krzysztof Kozlowski
@ 2020-09-01 15:49 ` Guenter Roeck
2020-10-02 16:31 ` Krzysztof Kozlowski
2020-09-01 20:18 ` Guenter Roeck
3 siblings, 1 reply; 11+ messages in thread
From: Guenter Roeck @ 2020-09-01 15:49 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Tue, Sep 01, 2020 at 05:31:39PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/cadence_wdt.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 672b184da875..bc99e9164930 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -334,12 +334,9 @@ static int cdns_wdt_probe(struct platform_device *pdev)
> watchdog_set_drvdata(cdns_wdt_device, wdt);
>
> wdt->clk = devm_clk_get(dev, NULL);
> - if (IS_ERR(wdt->clk)) {
> - ret = PTR_ERR(wdt->clk);
> - if (ret != -EPROBE_DEFER)
> - dev_err(dev, "input clock not found\n");
> - return ret;
> - }
> + if (IS_ERR(wdt->clk))
> + return dev_err_probe(dev, PTR_ERR(wdt->clk),
> + "input clock not found\n");
>
> ret = clk_prepare_enable(wdt->clk);
> if (ret) {
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] watchdog: davinci: Simplify with dev_err_probe()
2020-09-01 15:31 ` [PATCH 2/3] watchdog: davinci: " Krzysztof Kozlowski
@ 2020-09-01 15:50 ` Guenter Roeck
2020-09-01 20:19 ` Guenter Roeck
1 sibling, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2020-09-01 15:50 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Tue, Sep 01, 2020 at 05:31:40PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/davinci_wdt.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
> index 2b3f3cd382ef..e6eaba6bae5b 100644
> --- a/drivers/watchdog/davinci_wdt.c
> +++ b/drivers/watchdog/davinci_wdt.c
> @@ -206,12 +206,9 @@ static int davinci_wdt_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> davinci_wdt->clk = devm_clk_get(dev, NULL);
> -
> - if (IS_ERR(davinci_wdt->clk)) {
> - if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER)
> - dev_err(dev, "failed to get clock node\n");
> - return PTR_ERR(davinci_wdt->clk);
> - }
> + if (IS_ERR(davinci_wdt->clk))
> + return dev_err_probe(dev, PTR_ERR(davinci_wdt->clk),
> + "failed to get clock node\n");
>
> ret = clk_prepare_enable(davinci_wdt->clk);
> if (ret) {
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] watchdog: rti: Simplify with dev_err_probe()
2020-09-01 15:31 ` [PATCH 3/3] watchdog: rti: " Krzysztof Kozlowski
@ 2020-09-01 15:50 ` Guenter Roeck
2020-09-01 20:19 ` Guenter Roeck
1 sibling, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2020-09-01 15:50 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Tue, Sep 01, 2020 at 05:31:41PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>
> ---
>
> It is unusual to expect deferred probe from pm_runtime_get()...
> ---
> drivers/watchdog/rti_wdt.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
> index 705e8f7523e8..836319cbaca9 100644
> --- a/drivers/watchdog/rti_wdt.c
> +++ b/drivers/watchdog/rti_wdt.c
> @@ -205,11 +205,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> clk = clk_get(dev, NULL);
> - if (IS_ERR(clk)) {
> - if (PTR_ERR(clk) != -EPROBE_DEFER)
> - dev_err(dev, "failed to get clock\n");
> - return PTR_ERR(clk);
> - }
> + if (IS_ERR(clk))
> + return dev_err_probe(dev, PTR_ERR(clk), "failed to get clock\n");
>
> wdt->freq = clk_get_rate(clk);
>
> @@ -230,11 +227,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
>
> pm_runtime_enable(dev);
> ret = pm_runtime_get_sync(dev);
> - if (ret) {
> - if (ret != -EPROBE_DEFER)
> - dev_err(&pdev->dev, "runtime pm failed\n");
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "runtime pm failed\n");
>
> platform_set_drvdata(pdev, wdt);
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe()
2020-09-01 15:31 [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe() Krzysztof Kozlowski
` (2 preceding siblings ...)
2020-09-01 15:49 ` [PATCH 1/3] watchdog: cadence: " Guenter Roeck
@ 2020-09-01 20:18 ` Guenter Roeck
3 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2020-09-01 20:18 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Tue, Sep 01, 2020 at 05:31:39PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Hmm, I had replied to this but I don't see it on patchwork.
Trying again.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Guenter
> ---
> drivers/watchdog/cadence_wdt.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 672b184da875..bc99e9164930 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -334,12 +334,9 @@ static int cdns_wdt_probe(struct platform_device *pdev)
> watchdog_set_drvdata(cdns_wdt_device, wdt);
>
> wdt->clk = devm_clk_get(dev, NULL);
> - if (IS_ERR(wdt->clk)) {
> - ret = PTR_ERR(wdt->clk);
> - if (ret != -EPROBE_DEFER)
> - dev_err(dev, "input clock not found\n");
> - return ret;
> - }
> + if (IS_ERR(wdt->clk))
> + return dev_err_probe(dev, PTR_ERR(wdt->clk),
> + "input clock not found\n");
>
> ret = clk_prepare_enable(wdt->clk);
> if (ret) {
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] watchdog: davinci: Simplify with dev_err_probe()
2020-09-01 15:31 ` [PATCH 2/3] watchdog: davinci: " Krzysztof Kozlowski
2020-09-01 15:50 ` Guenter Roeck
@ 2020-09-01 20:19 ` Guenter Roeck
1 sibling, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2020-09-01 20:19 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Tue, Sep 01, 2020 at 05:31:40PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/davinci_wdt.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
> index 2b3f3cd382ef..e6eaba6bae5b 100644
> --- a/drivers/watchdog/davinci_wdt.c
> +++ b/drivers/watchdog/davinci_wdt.c
> @@ -206,12 +206,9 @@ static int davinci_wdt_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> davinci_wdt->clk = devm_clk_get(dev, NULL);
> -
> - if (IS_ERR(davinci_wdt->clk)) {
> - if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER)
> - dev_err(dev, "failed to get clock node\n");
> - return PTR_ERR(davinci_wdt->clk);
> - }
> + if (IS_ERR(davinci_wdt->clk))
> + return dev_err_probe(dev, PTR_ERR(davinci_wdt->clk),
> + "failed to get clock node\n");
>
> ret = clk_prepare_enable(davinci_wdt->clk);
> if (ret) {
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] watchdog: rti: Simplify with dev_err_probe()
2020-09-01 15:31 ` [PATCH 3/3] watchdog: rti: " Krzysztof Kozlowski
2020-09-01 15:50 ` Guenter Roeck
@ 2020-09-01 20:19 ` Guenter Roeck
1 sibling, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2020-09-01 20:19 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Tue, Sep 01, 2020 at 05:31:41PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>
> ---
>
> It is unusual to expect deferred probe from pm_runtime_get()...
> ---
> drivers/watchdog/rti_wdt.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
> index 705e8f7523e8..836319cbaca9 100644
> --- a/drivers/watchdog/rti_wdt.c
> +++ b/drivers/watchdog/rti_wdt.c
> @@ -205,11 +205,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> clk = clk_get(dev, NULL);
> - if (IS_ERR(clk)) {
> - if (PTR_ERR(clk) != -EPROBE_DEFER)
> - dev_err(dev, "failed to get clock\n");
> - return PTR_ERR(clk);
> - }
> + if (IS_ERR(clk))
> + return dev_err_probe(dev, PTR_ERR(clk), "failed to get clock\n");
>
> wdt->freq = clk_get_rate(clk);
>
> @@ -230,11 +227,8 @@ static int rti_wdt_probe(struct platform_device *pdev)
>
> pm_runtime_enable(dev);
> ret = pm_runtime_get_sync(dev);
> - if (ret) {
> - if (ret != -EPROBE_DEFER)
> - dev_err(&pdev->dev, "runtime pm failed\n");
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "runtime pm failed\n");
>
> platform_set_drvdata(pdev, wdt);
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe()
2020-09-01 15:49 ` [PATCH 1/3] watchdog: cadence: " Guenter Roeck
@ 2020-10-02 16:31 ` Krzysztof Kozlowski
2020-10-02 17:37 ` Guenter Roeck
0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2020-10-02 16:31 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Tue, Sep 01, 2020 at 08:49:52AM -0700, Guenter Roeck wrote:
> On Tue, Sep 01, 2020 at 05:31:39PM +0200, Krzysztof Kozlowski wrote:
> > Common pattern of handling deferred probe can be simplified with
> > dev_err_probe(). Less code and the error value gets printed.
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Thanks for the review. Who could pick up these patches?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe()
2020-10-02 16:31 ` Krzysztof Kozlowski
@ 2020-10-02 17:37 ` Guenter Roeck
0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2020-10-02 17:37 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: Wim Van Sebroeck, linux-watchdog, linux-kernel
On Fri, Oct 02, 2020 at 06:31:24PM +0200, Krzysztof Kozlowski wrote:
> On Tue, Sep 01, 2020 at 08:49:52AM -0700, Guenter Roeck wrote:
> > On Tue, Sep 01, 2020 at 05:31:39PM +0200, Krzysztof Kozlowski wrote:
> > > Common pattern of handling deferred probe can be simplified with
> > > dev_err_probe(). Less code and the error value gets printed.
> > >
> > > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> >
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>
> Thanks for the review. Who could pick up these patches?
>
They are queued up in my watchdog-next branch, and Wim usually
picks up patches from there.
Guenter
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-10-02 17:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 15:31 [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-01 15:31 ` [PATCH 2/3] watchdog: davinci: " Krzysztof Kozlowski
2020-09-01 15:50 ` Guenter Roeck
2020-09-01 20:19 ` Guenter Roeck
2020-09-01 15:31 ` [PATCH 3/3] watchdog: rti: " Krzysztof Kozlowski
2020-09-01 15:50 ` Guenter Roeck
2020-09-01 20:19 ` Guenter Roeck
2020-09-01 15:49 ` [PATCH 1/3] watchdog: cadence: " Guenter Roeck
2020-10-02 16:31 ` Krzysztof Kozlowski
2020-10-02 17:37 ` Guenter Roeck
2020-09-01 20:18 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).