From patchwork Fri Nov 25 08:29:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiancheng Xue X-Patchwork-Id: 84045 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp16789obn; Fri, 25 Nov 2016 00:48:20 -0800 (PST) X-Received: by 10.84.218.70 with SMTP id f6mr15186905plm.142.1480063700118; Fri, 25 Nov 2016 00:48:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si43642091pgf.282.2016.11.25.00.48.19; Fri, 25 Nov 2016 00:48:20 -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 S1754197AbcKYIsL (ORCPT + 25 others); Fri, 25 Nov 2016 03:48:11 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:21648 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754159AbcKYIr4 (ORCPT ); Fri, 25 Nov 2016 03:47:56 -0500 Received: from 172.24.1.137 (EHLO szxeml433-hub.china.huawei.com) ([172.24.1.137]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DRG57461; Fri, 25 Nov 2016 16:47:41 +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; Fri, 25 Nov 2016 16:47:31 +0800 From: Jiancheng Xue To: CC: , , , , , Subject: [PATCH] reset: ti_syscon: fix a ti_syscon_reset_status issue Date: Fri, 25 Nov 2016 16:29:37 +0800 Message-ID: <1480062577-11505-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 is not set, ti_syscon_reset_status always returned 0 no matter the status_bit is set or not. Signed-off-by: Jiancheng Xue --- 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 --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 = {