[PATCH v4 2/6] arm: at91: wdt: Rename regval in priv data to mr

Stefan Roese sr at denx.de
Mon May 5 08:47:17 CEST 2025


On 28.04.25 11:16, Zixun LI wrote:
> Use the name "mr" since we are referring to timer mode register.
> 
> Signed-off-by: Zixun LI <admin at hifiphile.com>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   arch/arm/mach-at91/include/mach/at91_wdt.h | 2 +-
>   drivers/watchdog/at91sam9_wdt.c            | 8 ++++----
>   2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/include/mach/at91_wdt.h b/arch/arm/mach-at91/include/mach/at91_wdt.h
> index 78ad0453fd9eb3e42674d10cb11ce3da820cdc6a..a5accbae52186e99de0b113d6982a4cc54e36095 100644
> --- a/arch/arm/mach-at91/include/mach/at91_wdt.h
> +++ b/arch/arm/mach-at91/include/mach/at91_wdt.h
> @@ -21,7 +21,7 @@
>   
>   struct at91_wdt_priv {
>   	void __iomem *regs;
> -	u32 regval;
> +	u32 mr;
>   };
>   
>   #endif
> diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
> index c809a8936b8968c3322db4c86bc0571fbdfe3ae2..dab7b6a9b8ca09e6113109391560434ffe1f7cb6 100644
> --- a/drivers/watchdog/at91sam9_wdt.c
> +++ b/drivers/watchdog/at91sam9_wdt.c
> @@ -60,11 +60,11 @@ 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->regval = AT91_WDT_MR_WDRSTEN	/* causes watchdog reset */
> +	priv->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->regval, priv->regs + AT91_WDT_MR);
> +	writel(priv->mr, priv->regs + AT91_WDT_MR);
>   
>   	return 0;
>   }
> @@ -74,8 +74,8 @@ static int at91_wdt_stop(struct udevice *dev)
>   	struct at91_wdt_priv *priv = dev_get_priv(dev);
>   
>   	/* Disable Watchdog Timer */
> -	priv->regval |= AT91_WDT_MR_WDDIS;
> -	writel(priv->regval, priv->regs + AT91_WDT_MR);
> +	priv->mr |= AT91_WDT_MR_WDDIS;
> +	writel(priv->mr, priv->regs + AT91_WDT_MR);
>   
>   	return 0;
>   }
> 

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de



More information about the U-Boot mailing list