Hi Stefan,

On 11/15/22 08:22, Stefan Roese wrote:
On 14.11.22 13:52, Quentin Schulz wrote:
From: Quentin Schulz <[email protected]>

Checking for DM_RESET is not enough since not all watchdog
implementations use a reset lane. Such is the case for Rockchip
implementation for example. Since reset_assert_bulk will only succeed if
the resets property exists in the watchdog DT node, it needs to be
called only if a reset property is present.

This adds a condition on the resets property presence in the watchdog DT
node before assuming a reset lane needs to be fetched with
reset_assert_bulk, by calling ofnode_read_prop.

Cc: Quentin Schulz <[email protected]>
Signed-off-by: Quentin Schulz <[email protected]>
---
To: Stefan Roese <[email protected]>
Cc: [email protected]

Reviewed-by: Stefan Roese <[email protected]>

Thanks,
Stefan

---
  drivers/watchdog/designware_wdt.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
index cad756aeaf..6155939f49 100644
--- a/drivers/watchdog/designware_wdt.c
+++ b/drivers/watchdog/designware_wdt.c
@@ -72,13 +72,13 @@ static int designware_wdt_reset(struct udevice *dev)
  static int designware_wdt_stop(struct udevice *dev)
  {
      struct designware_wdt_priv *priv = dev_get_priv(dev);
+    __maybe_unused int ret;
      designware_wdt_reset(dev);
      writel(0, priv->base + DW_WDT_CR);
-        if (CONFIG_IS_ENABLED(DM_RESET)) {
-        int ret;
-
+        if (CONFIG_IS_ENABLED(DM_RESET) &&

You seem to be adding spaces instead of a tab here.


It is currently indented with spaces, I just added my condition there :)

But will spin a v2 with this suggested change, I'm all for consistency :)

Cheers,
Quentin

Reply via email to