[PATCH] misc: ad525x_dpot: use assign_bit() where applicable

Peng Fan (OSS) posted 1 patch 5 days, 8 hours ago
drivers/misc/ad525x_dpot.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH] misc: ad525x_dpot: use assign_bit() where applicable
Posted by Peng Fan (OSS) 5 days, 8 hours ago
From: Peng Fan <peng.fan@nxp.com>

Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/misc/ad525x_dpot.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index a4e22fd4a107..97f124b1980d 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -451,10 +451,8 @@ static ssize_t sysfs_set_reg(struct device *dev,
 	int err;
 
 	if (reg & DPOT_ADDR_OTP_EN) {
-		if (sysfs_streq(buf, "enabled"))
-			set_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask);
-		else
-			clear_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask);
+		assign_bit(DPOT_RDAC_MASK & reg, data->otp_en_mask,
+			   sysfs_streq(buf, "enabled"));
 
 		return count;
 	}
-- 
2.51.0