[PATCH 3/9] mfd: da9063: use da906x_reg_update()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Enrico Scholz <enrico.scholz@xxxxxxxxxxxxxxxxx>

Use the previously added da906x_reg_update() function.

NOTE: patch depends on another patchset ("da9063: reset watchdog
timer"),

Signed-off-by: Enrico Scholz <enrico.scholz@xxxxxxxxxxxxxxxxx>
Tested-by: Stefan Christ <s.christ@xxxxxxxxx>
Signed-off-by: Christian Hemp <c.hemp@xxxxxxxxx>
---
 drivers/mfd/da9063.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/da9063.c b/drivers/mfd/da9063.c
index 68b0723b61..4f09bd384e 100644
--- a/drivers/mfd/da9063.c
+++ b/drivers/mfd/da9063.c
@@ -111,7 +111,6 @@ static int da9063_watchdog_set_timeout(struct watchdog *wd, unsigned timeout)
 	struct device_d *dev = priv->dev;
 	unsigned int scale = 0;
 	int ret;
-	u8 val;
 
 	if (timeout > 131)
 		return -EINVAL;
@@ -132,14 +131,8 @@ static int da9063_watchdog_set_timeout(struct watchdog *wd, unsigned timeout)
 		scale++; /* scale 0 disables the WD */
 	}
 
-	ret = i2c_read_reg(priv->client, DA9063_REG_CONTROL_D, &val, 1);
-	if (ret < 0)
-		return ret;
-
-	val &= ~DA9063_TWDSCALE_MASK;
-	val |= scale;
-
-	ret = i2c_write_reg(priv->client, DA9063_REG_CONTROL_D, &val, 1);
+	ret = da906x_reg_update(priv, DA9063_REG_CONTROL_D,
+				DA9063_TWDSCALE_MASK, scale);
 	if (ret < 0)
 		return ret;
 
-- 
2.16.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux