From: Zixun LI <admin@hifiphile.com>
To: Stefan Roese <sr@denx.de>, Tom Rini <trini@konsulko.com>
Cc: Zixun LI <admin@hifiphile.com>, u-boot@lists.denx.de
Subject: [PATCH 3/7] watchdog: at91sam9_wdt: Rename priv to wdt
Date: Mon, 31 Mar 2025 21:15:12 +0200 [thread overview]
Message-ID: <20250331191520.1805001-4-admin@hifiphile.com> (raw)
In-Reply-To: <20250331191520.1805001-1-admin@hifiphile.com>
"wdt" is a better name for watchdog rather than generic "priv".
Signed-off-by: Zixun LI <admin@hifiphile.com>
---
drivers/watchdog/at91sam9_wdt.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index dab7b6a9b8c..5ca3e5a5fde 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
*/
static int at91_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
{
- struct at91_wdt_priv *priv = dev_get_priv(dev);
+ struct at91_wdt_priv *wdt = dev_get_priv(dev);
u64 timeout;
u32 ticks;
@@ -49,7 +49,7 @@ static int at91_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
ticks = WDT_SEC2TICKS(timeout);
/* Check if disabled */
- if (readl(priv->regs + AT91_WDT_MR) & AT91_WDT_MR_WDDIS) {
+ if (readl(wdt->regs + AT91_WDT_MR) & AT91_WDT_MR_WDDIS) {
printf("sorry, watchdog is disabled\n");
return -1;
}
@@ -60,31 +60,31 @@ static int at91_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
* Since WDV is a 12-bit counter, the maximum period is
* 4096 / 256 = 16 seconds.
*/
- priv->mr = AT91_WDT_MR_WDRSTEN /* causes watchdog reset */
+ wdt->mr = AT91_WDT_MR_WDRSTEN /* causes watchdog reset */
| AT91_WDT_MR_WDDBGHLT /* disabled in debug mode */
| AT91_WDT_MR_WDD(0xfff) /* restart at any time */
| AT91_WDT_MR_WDV(ticks); /* timer value */
- writel(priv->mr, priv->regs + AT91_WDT_MR);
+ writel(wdt->mr, wdt->regs + AT91_WDT_MR);
return 0;
}
static int at91_wdt_stop(struct udevice *dev)
{
- struct at91_wdt_priv *priv = dev_get_priv(dev);
+ struct at91_wdt_priv *wdt = dev_get_priv(dev);
/* Disable Watchdog Timer */
- priv->mr |= AT91_WDT_MR_WDDIS;
- writel(priv->mr, priv->regs + AT91_WDT_MR);
+ wdt->mr |= AT91_WDT_MR_WDDIS;
+ writel(wdt->mr, wdt->regs + AT91_WDT_MR);
return 0;
}
static int at91_wdt_reset(struct udevice *dev)
{
- struct at91_wdt_priv *priv = dev_get_priv(dev);
+ struct at91_wdt_priv *wdt = dev_get_priv(dev);
- writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, priv->regs + AT91_WDT_CR);
+ writel(AT91_WDT_CR_WDRSTT | AT91_WDT_CR_KEY, wdt->regs + AT91_WDT_CR);
return 0;
}
@@ -102,10 +102,10 @@ static const struct udevice_id at91_wdt_ids[] = {
static int at91_wdt_probe(struct udevice *dev)
{
- struct at91_wdt_priv *priv = dev_get_priv(dev);
+ struct at91_wdt_priv *wdt = dev_get_priv(dev);
- priv->regs = dev_remap_addr(dev);
- if (!priv->regs)
+ wdt->regs = dev_remap_addr(dev);
+ if (!wdt->regs)
return -EINVAL;
debug("%s: Probing wdt%u\n", __func__, dev_seq(dev));
--
2.49.0
next prev parent reply other threads:[~2025-03-31 19:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250331191520.1805001-1-admin@hifiphile.com>
2025-03-31 19:15 ` [PATCH 1/7] arm: at91: wdt: Remove unused at91_wdt struct Zixun LI
2025-04-02 21:00 ` [PATCH 0/7] watchdog: at91sam9_wdt driver enhancement Zixun LI
2025-04-10 10:28 ` [PATCH 1/7] arm: at91: wdt: Remove unused at91_wdt struct Eugen Hristev
2025-04-10 16:42 ` Zixun LI
2025-03-31 19:15 ` [PATCH 2/7] arm: at91: wdt: Rename regval in priv data to mr Zixun LI
2025-03-31 19:15 ` Zixun LI [this message]
2025-03-31 19:15 ` [PATCH 4/7] arm: at91: wdt: Add SAM9X60 register definition Zixun LI
2025-03-31 19:15 ` [PATCH 5/7] watchdog: at91sam9_wdt: Add SAM9X60 support Zixun LI
2025-03-31 19:15 ` [PATCH 6/7] ARM: dts: sam9x60: Add watchdog DT node Zixun LI
2025-03-31 19:15 ` [PATCH 7/7] ARM: dts: at91: sam9x60-curiosity: Enable watchdog node Zixun LI
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=20250331191520.1805001-4-admin@hifiphile.com \
--to=admin@hifiphile.com \
--cc=sr@denx.de \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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