reset: ti_syscon: fix a ti_syscon_reset_status issue

[ Upstream commit 5987b4bf51 ]

If STATUS_SET was not set, ti_syscon_reset_status would always return 0
no matter whether the status_bit was set or not.

Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
Fixes: cc7c2bb149 ("reset: add TI SYSCON based reset driver")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiancheng Xue 2016-11-30 09:03:32 +08:00 committed by Greg Kroah-Hartman
parent 6798f079b0
commit bed7533196

View File

@ -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);
return !(reset_state & BIT(control->status_bit)) ==
!(control->flags & STATUS_SET);
}
static struct reset_control_ops ti_syscon_reset_ops = {