summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2025-04-28 11:16:25 +0200
committerEugen Hristev <[email protected]>2025-06-19 13:56:13 +0300
commitc8bf2d686d45ff508e953d81c718e4dfd7d8ce62 (patch)
tree1bbe7466584974e91d6ec736ebd2a6197a0c9e06
parent98a83fc23bfedc85016e9db98ba459805232180d (diff)
watchdog: at91sam9_wdt: Rename priv to wdt
"wdt" is a better name for watchdog rather than generic "priv". Signed-off-by: Zixun LI <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
-rw-r--r--drivers/watchdog/at91sam9_wdt.c24
1 files 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));