[PATCH net-next v1 1/2] net: dsa: microchip: rework ksz_prmw8

Oleksij Rempel posted 2 patches 2 years, 10 months ago
[PATCH net-next v1 1/2] net: dsa: microchip: rework ksz_prmw8
Posted by Oleksij Rempel 2 years, 10 months ago
This patch modifies the ksz_prmw8() function in the ksz_common.h file to
return the error value and reuse already existing ksz_rmw8() function.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa/microchip/ksz_common.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index 8abecaf6089e..69c9a19aa4c3 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -549,12 +549,11 @@ static inline int ksz_pwrite32(struct ksz_device *dev, int port, int offset,
 			   data);
 }
 
-static inline void ksz_prmw8(struct ksz_device *dev, int port, int offset,
+static inline int ksz_prmw8(struct ksz_device *dev, int port, int offset,
 			     u8 mask, u8 val)
 {
-	regmap_update_bits(dev->regmap[0],
-			   dev->dev_ops->get_port_addr(port, offset),
-			   mask, val);
+	return ksz_rmw8(dev, dev->dev_ops->get_port_addr(port, offset), mask,
+			val);
 }
 
 static inline void ksz_regmap_lock(void *__mtx)
-- 
2.39.2