]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pinctrl: renesas: Fix DRV register offset
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Wed, 13 Jun 2018 06:02:55 +0000 (08:02 +0200)
committerMarek Vasut <marex@denx.de>
Fri, 2 Nov 2018 14:57:13 +0000 (15:57 +0100)
Use fixed 4bit size for generating the DRV register element mask,
not the size of the value, which can be smaller.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
drivers/pinctrl/renesas/pfc.c

index 90011537a856444863c6f5538c047bc037fa9879..b3a4ff9049d093d00fdf67819700c2ec73c8c587 100644 (file)
@@ -591,7 +591,7 @@ static int sh_pfc_pinconf_set_drive_strength(struct sh_pfc *pfc,
        strength = strength / step - 1;
 
        val = sh_pfc_read_raw_reg(reg, 32);
-       val &= ~GENMASK(offset + size - 1, offset);
+       val &= ~GENMASK(offset + 4 - 1, offset);
        val |= strength << offset;
 
        if (unlock_reg)