Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2375990ybg; Fri, 5 Jun 2020 12:17:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygVC+NGz9REFP+JqS/nADQ7mIE3F2OJ8WL4kFmVNlAKEVhyBzRJBDjO1BXC3hUgLhSH+32 X-Received: by 2002:a17:906:15cb:: with SMTP id l11mr9787379ejd.224.1591384631141; Fri, 05 Jun 2020 12:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591384631; cv=none; d=google.com; s=arc-20160816; b=GQNk675qUTpOZXmBp2pfVXtcwY1DtMrC9slXXzUXCSpgZOtz+RRxx/tQ56lhaIInGD t78h+VF0yC5qKZX03mYGPxhhvz1L7EOIznF0toximQKo5ELP3xbfSuFWJVwNBVN8CRiW WIpPArpmBiQrrEhF8BHWDYcb3Bc845nWPOr00Hxj+7U17gw4dgcBZ//3kBwJuJG+ak99 fA/gXmivmouyn1XPNtsQqGmu5sTCU21iySPsLQO1te/awgK72meOjUtPG+WSX7LLnJQ1 IkE2cKIXLCt0DBivHwzT9YVEINFqO7IZbM/YD5ygyR6BLFj3CmQTcpf/PM+n46J6TA9S 4KeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=pW/NC7zyGgCVnaE2/b9PeCQ7NYEWJXjZ3Xg7zwHZYno=; b=tLepdOIhA7UlYSt7Py3LXdq8vU3mkR3g+FTd9uNtJbi9XSBgKYMS2RlvX5sKKph7F2 fJxYdtL6R7j5WNe6pSI5ZXZs5uagdKrse+n1cjAfI7AmMWH9g0Tfh7V99SKM6GsbCjvr tXV0M6jrdOBuH0pDNYgWbughI1ZJdFtfKBVXUdXBFsUhX7iQ11KkllyFw9dhXOv10PhV MuigyzIDsp1o3K8JrMkunzy4cESwNyGl9zFRJ9wVSOn8qHJCbehWsXK/9ZS3mTZHCO1l zPNbVt3HvI/2v1C7hYPNdxJDqTEN70rEQ6vwMWUx5R7uAXR4Xwz0ozti3JVLf88Pm6em xgHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kkQsqilh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si4267440edq.313.2020.06.05.12.16.48; Fri, 05 Jun 2020 12:17:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kkQsqilh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728067AbgFETO7 (ORCPT + 99 others); Fri, 5 Jun 2020 15:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727917AbgFETOx (ORCPT ); Fri, 5 Jun 2020 15:14:53 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53888C08C5C2; Fri, 5 Jun 2020 12:14:53 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id g1so8297867edv.6; Fri, 05 Jun 2020 12:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pW/NC7zyGgCVnaE2/b9PeCQ7NYEWJXjZ3Xg7zwHZYno=; b=kkQsqilhvLTzz/QlVysY2oS3rFrNu6HO/45WFulh7tiX9ri3virfItEjj/+t7xzyM6 FtvIhGmcd8QQmrKfTIxkyaZkNudAv7EMY1SRxRHGTLnD1f683KGefociP3xGSjHUynPr 0riwbGch/o2cTTIj/qG5F9OKVUWaQBI9tWl+V1P9zvRoFoqnVDUaKktFmLMRbnR9p6u1 ZzHi1rlU82XN4hb9AYONaO+Ncp7GExyZbPE6322BrTEp4G+8vkdW92XfsU/M2gGEesN7 S27V1WDTF6QPsphd/6EeAGzFGm6VfYPCcc0bxhiafIkoS026lJX/mlHBC0nHn/DUzYmg 9VcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pW/NC7zyGgCVnaE2/b9PeCQ7NYEWJXjZ3Xg7zwHZYno=; b=WsabeR9QV5F2JC2wyRGS+DZySGqQgFdMNZNEAGVuxyLaC/ekOuUl9yWvQR/VMbQw83 3BNDDCIS/+nJKePLdV/SxSDslu2cFV33QUevjRoxrRGsiKskrzUOE3+DC074yokm7lzp L3us4fX1/8YX21/qiJaKnrgdUzGc5VRoqNoxha16xM97yaKd8LkWJPaPtA95rnhKbpro m8JlLI+iwq8Al94Jyk2fZPZSk7NO70a8uUKw0cf4lzqWGVjXyzhK7czA5ggnRoDhayUx 9jp5ICQ9JBx5aBev3VWFLVxIqp8ikJ1ng4NZVrVdZ3kul0QZE5wtHtB7SzpEIU2Lre0S PZuQ== X-Gm-Message-State: AOAM532g6xYBqvKpVXNFBhBQ6XOseFlbgvvBDuG0lOk4Il2uTAr1tnOq YjNQhgFP0iI9cswozLFZEWw= X-Received: by 2002:a50:cfc4:: with SMTP id i4mr10567875edk.252.1591384492046; Fri, 05 Jun 2020 12:14:52 -0700 (PDT) Received: from localhost.localdomain (ip5f5bfcfd.dynamic.kabel-deutschland.de. [95.91.252.253]) by smtp.gmail.com with ESMTPSA id ck11sm5123614ejb.41.2020.06.05.12.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 12:14:51 -0700 (PDT) From: Bean Huo To: alim.akhtar@samsung.com, avri.altman@wdc.com, asutoshd@codeaurora.org, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] scsi: ufs: remove wrapper function ufshcd_setup_clocks() Date: Fri, 5 Jun 2020 21:14:39 +0200 Message-Id: <20200605191439.19313-3-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200605191439.19313-1-huobean@gmail.com> References: <20200605191439.19313-1-huobean@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo The static function ufshcd_setup_clocks() is just a wrapper around __ufshcd_setup_clocks(), remove it. Rename original function wrapped __ufshcd_setup_clocks() to new ufshcd_setup_clocks(). Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e2939382897d..3ad6aac9f193 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -215,9 +215,7 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd); static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag); static void ufshcd_hba_exit(struct ufs_hba *hba); static int ufshcd_probe_hba(struct ufs_hba *hba, bool async); -static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, - bool skip_ref_clk); -static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on); +static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on, bool skip_ref_clk); static int ufshcd_uic_hibern8_enter(struct ufs_hba *hba); static inline void ufshcd_add_delay_before_dme_cmd(struct ufs_hba *hba); static int ufshcd_host_reset_and_restore(struct ufs_hba *hba); @@ -1497,7 +1495,7 @@ static void ufshcd_ungate_work(struct work_struct *work) } spin_unlock_irqrestore(hba->host->host_lock, flags); - ufshcd_setup_clocks(hba, true); + ufshcd_setup_clocks(hba, true, false); ufshcd_enable_irq(hba); @@ -1655,10 +1653,10 @@ static void ufshcd_gate_work(struct work_struct *work) ufshcd_disable_irq(hba); if (!ufshcd_is_link_active(hba)) - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); else /* If link is active, device ref_clk can't be switched off */ - __ufshcd_setup_clocks(hba, false, true); + ufshcd_setup_clocks(hba, false, true); /* * In case you are here to cancel this work the gating state @@ -7683,8 +7681,7 @@ static int ufshcd_init_hba_vreg(struct ufs_hba *hba) return 0; } -static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, - bool skip_ref_clk) +static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on, bool skip_ref_clk) { int ret = 0; struct ufs_clk_info *clki; @@ -7747,11 +7744,6 @@ static int __ufshcd_setup_clocks(struct ufs_hba *hba, bool on, return ret; } -static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on) -{ - return __ufshcd_setup_clocks(hba, on, false); -} - static int ufshcd_init_clocks(struct ufs_hba *hba) { int ret = 0; @@ -7858,7 +7850,7 @@ static int ufshcd_hba_init(struct ufs_hba *hba) if (err) goto out_disable_hba_vreg; - err = ufshcd_setup_clocks(hba, true); + err = ufshcd_setup_clocks(hba, true, false); if (err) goto out_disable_hba_vreg; @@ -7880,7 +7872,7 @@ static int ufshcd_hba_init(struct ufs_hba *hba) out_disable_vreg: ufshcd_setup_vreg(hba, false); out_disable_clks: - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); out_disable_hba_vreg: ufshcd_setup_hba_vreg(hba, false); out: @@ -7896,7 +7888,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba) if (ufshcd_is_clkscaling_supported(hba)) if (hba->devfreq) ufshcd_suspend_clkscaling(hba); - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); ufshcd_setup_hba_vreg(hba, false); hba->is_powered = false; ufs_put_device_desc(hba); @@ -8259,10 +8251,10 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufshcd_disable_irq(hba); if (!ufshcd_is_link_active(hba)) - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); else /* If link is active, device ref_clk can't be switched off */ - __ufshcd_setup_clocks(hba, false, true); + ufshcd_setup_clocks(hba, false, true); hba->clk_gating.state = CLKS_OFF; trace_ufshcd_clk_gating(dev_name(hba->dev), hba->clk_gating.state); @@ -8321,7 +8313,7 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufshcd_hba_vreg_set_hpm(hba); /* Make sure clocks are enabled before accessing controller */ - ret = ufshcd_setup_clocks(hba, true); + ret = ufshcd_setup_clocks(hba, true, false); if (ret) goto out; @@ -8404,7 +8396,7 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufshcd_disable_irq(hba); if (hba->clk_scaling.is_allowed) ufshcd_suspend_clkscaling(hba); - ufshcd_setup_clocks(hba, false); + ufshcd_setup_clocks(hba, false, false); out: hba->pm_op_in_progress = 0; if (ret) -- 2.17.1