Skip to contentSkip to conversation

auxdisplay: max6959: use regmap_assign_bits() in max6959_enable()

PATCH In review Andy Shevchenko 1 participant 2 messages May 4 – May 5 Auxiliary display drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 auxdisplay: max6959: use regmap_assign_bits() in max6959_enable()

Replace the ternary with a direct call to the regmap_assign_bits() helper and save a couple lines of code.

---
 drivers/auxdisplay/max6959.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/auxdisplay/max6959.c +1 -4
index 6bbc8d48fb1b..3bdef099a225 100644
@@ -86,10 +86,7 @@ static const struct linedisp_ops max6959_linedisp_ops = {
 
 static int max6959_enable(struct max6959_priv *priv, bool enable)
 {
-	u8 mask = REG_CONFIGURATION_S_BIT;
-	u8 value = enable ? mask : 0;
-
-	return regmap_update_bits(priv->regmap, REG_CONFIGURATION, mask, value);
+	return regmap_assign_bits(priv->regmap, REG_CONFIGURATION, REG_CONFIGURATION_S_BIT, enable);
 }
 
 static void max6959_power_off(void *priv)
Signature · 1 line
2.50.1
#1 lore raw
Quoted 2 lines · Andy Shevchenko

Replace the ternary with a direct call to the regmap_assign_bits() helper and save a couple lines of code.

Pushed to my review and testing queue, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko