From patchwork Wed Nov 30 01:03:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiancheng Xue X-Patchwork-Id: 84933 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp35122qgi; Tue, 29 Nov 2016 17:23:28 -0800 (PST) X-Received: by 10.84.172.67 with SMTP id m61mr66364535plb.60.1480469007979; Tue, 29 Nov 2016 17:23:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si33407014plm.51.2016.11.29.17.23.19; Tue, 29 Nov 2016 17:23:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755602AbcK3BWR (ORCPT + 25 others); Tue, 29 Nov 2016 20:22:17 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:2320 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753195AbcK3BWL (ORCPT ); Tue, 29 Nov 2016 20:22:11 -0500 Received: from 172.24.1.47 (EHLO szxeml433-hub.china.huawei.com) ([172.24.1.47]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DRL98940; Wed, 30 Nov 2016 09:22:04 +0800 (CST) Received: from wind-Tecal-RH2285.huawei.com (10.67.212.71) by szxeml433-hub.china.huawei.com (10.82.67.210) with Microsoft SMTP Server id 14.3.235.1; Wed, 30 Nov 2016 09:21:57 +0800 From: Jiancheng Xue To: CC: , , , , , Subject: [PATCH v2] reset: ti_syscon: fix a ti_syscon_reset_status issue Date: Wed, 30 Nov 2016 09:03:32 +0800 Message-ID: <1480467812-32507-1-git-send-email-xuejiancheng@hisilicon.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.71] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Change Log v2: - Refined this patch according to the suggestion from Andrew F. Davis. drivers/reset/reset-ti-syscon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 Tested-by: Suman Anna diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c index 47f0ffd..1799fd4 100644 --- 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); + return !(reset_state & BIT(control->status_bit)) == + !(control->flags & STATUS_SET); } static struct reset_control_ops ti_syscon_reset_ops = {