From: Xingyu Wu <xingyu.wu@starfivetech.com>
To: <linux-watchdog@vger.kernel.org>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>
Cc: Xingyu Wu <xingyu.wu@starfivetech.com>,
Samin Guo <samin.guo@starfivetech.com>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v1] watchdog: starfive: Fix the probe return error if PM and early_enable are both disabled
Date: Tue, 25 Apr 2023 18:04:56 +0800 [thread overview]
Message-ID: <20230425100456.32718-1-xingyu.wu@starfivetech.com> (raw)
When the starfive watchdog driver uses 'pm_runtime_put_sync()' as probe
return value at last and 'early_enable' is disabled, it could return the
error '-ENOSYS' if the CONFIG_PM is disabled, but the driver should works
normally.
Add a check to make sure the PM is enabled and then use
'pm_runtime_put_sync()' as return value when 'early_enable' is disabled.
Fixes: db728ea9c7be ("drivers: watchdog: Add StarFive Watchdog driver")
Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
---
Hi, Guenter and Wim,
This patch fixes the issue of StarFive watchdog driver and rebases on
the master branch of linux-next.
Thanks.
---
drivers/watchdog/starfive-wdt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
index 1995cceca51e..51e487e09960 100644
--- a/drivers/watchdog/starfive-wdt.c
+++ b/drivers/watchdog/starfive-wdt.c
@@ -492,7 +492,8 @@ static int starfive_wdt_probe(struct platform_device *pdev)
goto err_exit;
if (!early_enable)
- return pm_runtime_put_sync(&pdev->dev);
+ if (pm_runtime_enabled(&pdev->dev))
+ return pm_runtime_put_sync(&pdev->dev);
return 0;
--
2.25.1
next reply other threads:[~2023-04-25 10:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 10:04 Xingyu Wu [this message]
2023-04-25 14:06 ` [PATCH v1] watchdog: starfive: Fix the probe return error if PM and early_enable are both disabled Guenter Roeck
2023-04-26 1:49 ` Xingyu Wu
2023-04-26 2:01 ` Guenter Roeck
2023-04-26 2:44 ` Xingyu Wu
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=20230425100456.32718-1-xingyu.wu@starfivetech.com \
--to=xingyu.wu@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=samin.guo@starfivetech.com \
--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