diff mbox

reset: ti_syscon: fix a ti_syscon_reset_status issue

Message ID 1480062577-11505-1-git-send-email-xuejiancheng@hisilicon.com
State Superseded
Headers show

Commit Message

Jiancheng Xue Nov. 25, 2016, 8:29 a.m. UTC
If STATUS_SET is not set, ti_syscon_reset_status always returned 0
no matter the status_bit is set or not.

Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>

---
 drivers/reset/reset-ti-syscon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 drivers/reset/reset-ti-syscon.c

-- 
1.9.1
diff mbox

Patch

diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c
old mode 100644
new mode 100755
index 47f0ffd..82769ff
--- a/drivers/reset/reset-ti-syscon.c
+++ b/drivers/reset/reset-ti-syscon.c
@@ -154,8 +154,8 @@  static int ti_syscon_reset_status(struct reset_controller_dev *rcdev,
 	if (ret)
 		return ret;
 
-	return (reset_state & BIT(control->status_bit)) &&
-			(control->flags & STATUS_SET);
+	ret = (reset_state & BIT(control->status_bit)) ? 1 : 0;
+	return (control->flags & STATUS_SET) ? ret : (!ret);
 }
 
 static struct reset_control_ops ti_syscon_reset_ops = {