[PATCH 1/3] power: reset: at91-sama5d2_shdwc: fix wkupdbc mask

Alexandre Belloni alexandre.belloni at bootlin.com
Wed Dec 16 08:40:15 EST 2020


On 16/12/2020 14:57:31+0200, Claudiu Beznea wrote:
> According to datasheet WKUPDBC mask is b/w bits 26..24.
> 
> Fixes: f80cb48843987 ("power: reset: at91-shdwc: add new shutdown controller driver")
> Signed-off-by: Claudiu Beznea <claudiu.beznea at microchip.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni at bootlin.com>

> ---
>  drivers/power/reset/at91-sama5d2_shdwc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
> index e90368ed6f71..3996167f676f 100644
> --- a/drivers/power/reset/at91-sama5d2_shdwc.c
> +++ b/drivers/power/reset/at91-sama5d2_shdwc.c
> @@ -37,7 +37,7 @@
>  
>  #define AT91_SHDW_MR	0x04		/* Shut Down Mode Register */
>  #define AT91_SHDW_WKUPDBC_SHIFT	24
> -#define AT91_SHDW_WKUPDBC_MASK	GENMASK(31, 16)
> +#define AT91_SHDW_WKUPDBC_MASK	GENMASK(26, 24)
>  #define AT91_SHDW_WKUPDBC(x)	(((x) << AT91_SHDW_WKUPDBC_SHIFT) \
>  						& AT91_SHDW_WKUPDBC_MASK)
>  

Maybe you would switch to FIELD_PREP to remove the need for 2 of those 3
macros and would have made the issue apparent right away.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the linux-arm-kernel mailing list