[PATCH 5/8] reset: mpfs: Use regmap_test_bits in mpfs_status

Philipp Zabel p.zabel at pengutronix.de
Tue Nov 3 06:51:25 PST 2026


Simplify mpfs_status() by using regmap_test_bits().
Now returns 1 if asserted for all bits.

Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
---
 drivers/reset/reset-mpfs.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/reset/reset-mpfs.c b/drivers/reset/reset-mpfs.c
index 8ffcc54ee6f6..ec61b4a1d753 100644
--- a/drivers/reset/reset-mpfs.c
+++ b/drivers/reset/reset-mpfs.c
@@ -63,15 +63,8 @@ static int mpfs_deassert(struct reset_controller_dev *rcdev, unsigned long id)
 static int mpfs_status(struct reset_controller_dev *rcdev, unsigned long id)
 {
 	struct mpfs_reset *rst = to_mpfs_reset(rcdev);
-	u32 reg;
 
-	regmap_read(rst->regmap, REG_SUBBLK_RESET_CR, &reg);
-
-	/*
-	 * It is safe to return here as MPFS_NUM_RESETS makes sure the sign bit
-	 * is never hit.
-	 */
-	return (reg & BIT(id));
+	return regmap_test_bits(rst->regmap, REG_SUBBLK_RESET_CR, BIT(id));
 }
 
 static int mpfs_reset(struct reset_controller_dev *rcdev, unsigned long id)

-- 
2.47.3




More information about the linux-riscv mailing list