From: Qiang Zhao <qiang.zhao@nxp.com>
To: a.zummo@towertech.it, alexandre.belloni@bootlin.com, robh+dt@kernel.org
Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
Zhao Qiang <qiang.zhao@nxp.com>
Subject: [Patch v2 2/3] rtc: pcf2127: add "no-watchdog" property
Date: Mon, 21 Sep 2020 13:48:20 +0800 [thread overview]
Message-ID: <20200921054821.26071-2-qiang.zhao@nxp.com> (raw)
In-Reply-To: <20200921054821.26071-1-qiang.zhao@nxp.com>
From: Zhao Qiang <qiang.zhao@nxp.com>
Commit 0e735eaae165 ("rtc: pcf2127: add watchdog feature support")
adds watchdog feature for pcf2127, then it will be registered as
a watchdog device even though it is not used as watchdog.
Pcf2127 always be registered as watchdog0(default watchdog device),
even though it is not used as watchdog, meanwhile there is another
real watchdog device registered as watchdog1.
So add "no-watchdog" property, if the node has this property,
driver will not register it as a watchdog device
Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
---
drivers/rtc/rtc-pcf2127.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
index ed63169..b50158a 100644
--- a/drivers/rtc/rtc-pcf2127.c
+++ b/drivers/rtc/rtc-pcf2127.c
@@ -624,9 +624,11 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
set_bit(WDOG_HW_RUNNING, &pcf2127->wdd.status);
#ifdef CONFIG_WATCHDOG
- ret = devm_watchdog_register_device(dev, &pcf2127->wdd);
- if (ret)
- return ret;
+ if (!of_property_read_bool(dev->of_node, "no-watchdog")) {
+ ret = devm_watchdog_register_device(dev, &pcf2127->wdd);
+ if (ret)
+ return ret;
+ }
#endif /* CONFIG_WATCHDOG */
/*
--
2.7.4
next prev parent reply other threads:[~2020-09-21 6:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 5:48 [Patch v2 1/3] dt-bindings: rtc: pcf2127: Add bindings for nxp,pcf2127 Qiang Zhao
2020-09-21 5:48 ` Qiang Zhao [this message]
2020-09-21 5:48 ` [Patch v2 3/3] arm64: dts: lx2160a: Add "no-watchdog" property to pcf2127 Qiang Zhao
2020-09-23 9:44 ` [Patch v2 1/3] dt-bindings: rtc: pcf2127: Add bindings for nxp,pcf2127 Alexandre Belloni
2020-09-24 3:20 ` Qiang Zhao
2020-09-24 7:04 ` Uwe Kleine-König
2020-09-24 7:23 ` Qiang Zhao
2020-09-24 7:47 ` Alexandre Belloni
2020-09-24 10:52 ` [PATCH 0/2] rtc: pcf2127: only use watchdog when explicitly available Uwe Kleine-König
2020-09-24 10:52 ` [PATCH 1/2] rtc: pcf2127: move watchdog initialisation to a separate function Uwe Kleine-König
2020-09-27 7:50 ` Bruno Thomsen
2020-09-24 10:52 ` [PATCH 2/2] [RFC] rtc: pcf2127: only use watchdog when explicitly available Uwe Kleine-König
2020-09-27 8:09 ` Bruno Thomsen
2020-09-27 15:54 ` Guenter Roeck
2020-09-28 8:43 ` Uwe Kleine-König
2020-09-28 16:26 ` Guenter Roeck
2020-10-26 7:23 ` [PATCH 0/2] " Qiang Zhao
2020-10-26 20:48 ` Alexandre Belloni
2020-10-26 21:29 ` Guenter Roeck
2020-11-30 9:51 ` Rasmus Villemoes
2020-12-04 9:27 ` Alexandre Belloni
2020-09-24 16:59 ` [Patch v2 1/3] dt-bindings: rtc: pcf2127: Add bindings for nxp,pcf2127 Bruno Thomsen
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=20200921054821.26071-2-qiang.zhao@nxp.com \
--to=qiang.zhao@nxp.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=robh+dt@kernel.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;
as well as URLs for NNTP newsgroup(s).