Skip to contentSkip to conversation

pinctrl: renesas: Fix DRV register offset

PATCH New Marek Vasut 1 participant 1 message Oct 31, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: renesas: Fix DRV register offset

Use fixed 4bit size for generating the DRV register element mask, not the size of the value, which can be smaller.

Cc Masahiro Yamada <[email protected]>
Cc Nobuhiro Iwamatsu <[email protected]>
---
 drivers/pinctrl/renesas/pfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/renesas/pfc.c +1 -1
index 90011537a8..b3a4ff9049 100644
@@ -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)
Signature · 1 line
2.18.0