[PATCH] reset: ti_syscon: fix a ti_syscon_reset_status issue
From: Jiancheng Xue
Date: Fri Nov 25 2016 - 03:48:15 EST
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@xxxxxxxxxxxxx>
---
drivers/reset/reset-ti-syscon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
mode change 100644 => 100755 drivers/reset/reset-ti-syscon.c
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 = {
--
1.9.1