[PATCH] reset: rzg2l-usbphy-ctrl: Correct reset status check

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

 



From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>

Ensure the reset status check explicitly evaluates whether all bits in
`port_mask` are set. Replace the double negation (`!!`) with an equality
check to prevent incorrect interpretation of partial bit matches as an
asserted reset.

Fixes: bee08559701f ("reset: renesas: Add RZ/G2L usbphy control driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
---
 drivers/reset/reset-rzg2l-usbphy-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
index 8a7f167e405e..6451f621e862 100644
--- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
+++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
@@ -88,7 +88,7 @@ static int rzg2l_usbphy_ctrl_status(struct reset_controller_dev *rcdev,
 
 	port_mask = id ? PHY_RESET_PORT2 : PHY_RESET_PORT1;
 
-	return !!(readl(priv->base + RESET) & port_mask);
+	return (readl(priv->base + RESET) & port_mask) == port_mask;
 }
 
 static const struct of_device_id rzg2l_usbphy_ctrl_match_table[] = {
-- 
2.43.0





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux