From patchwork Tue Nov 24 08:46:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 331380 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2110:0:0:0:0 with SMTP id qn16csp4193054ejb; Tue, 24 Nov 2020 00:51:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1da0S04gda6GILc0+jdFdfcVZSjYLdlK+vwGji6eFqx7TXZDm44tKsOUvZMDjwhOXvt0b X-Received: by 2002:a17:906:b003:: with SMTP id v3mr3428723ejy.290.1606207903071; Tue, 24 Nov 2020 00:51:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606207903; cv=none; d=google.com; s=arc-20160816; b=FLs2TVN44hqxzQNd//wFtOrYJJ20lT/4oYTg9wIrXMA+3rXK2bWltnOZg0hwFu7ABg kFA//75hWv5bTBxQ7MRtcftz3aR53+Iur8ukO14ScOPcHbR3pGfh+xc0l+6My/4wUsr9 DrqCRj3YDwhGzn4ExrLfUgOq63vOOvLw9SXr1+zW2Qd4oVewGUZmBYPNkibPcl3n0nXX /L1qi/5oUskXj4/7cfPDwfhR/y+e43SPr4K3NUURALXOnmxl+PUMvIKTG2+FLzBTDI7d wDcNFRwfMXfo8utEo/+77lk8FpaYzGkuedN5x8QohvpTM/VdP1eFZOnJhhBaC4ufUyVD Ap8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=448RktII+ce2oMZkcbiAuiDQ5xSqX27EXPiSA2RkeQg=; b=xvKUt2fLVAWaJyvz4ihkd0pr6IRIUQ+cu3zmWLRfY7zDsx2IBCUDQdNf/AWJ2ODX4n iIpWOL51PTguNgfexpTirSD9N/2RdnV0ikHi6rERCGQhXDfc5qY0ASypORjKVWZ+Vxtv Tzw0b6pYShCrjrtK72Pfsuy0TiexRvJMcjG+nOrEpI9MP4vTsf/f7zhoq/WOcJN2CUat tw0/RgcmB2Ff+1M7r8yOgeXeflbRhBhMjnVUjsEq+T1fybkcqfxaFXb5VJrrYtim5GaP Twpl/3qkbFO4X+EH/iAlsUpKf3DKQe/CC43aSNFzV90VACZcQLMzpwNy45SZVEcH9+RP CGEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 62si8482119edc.231.2020.11.24.00.51.43 for ; Tue, 24 Nov 2020 00:51:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730847AbgKXIud (ORCPT ); Tue, 24 Nov 2020 03:50:33 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7725 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730755AbgKXIud (ORCPT ); Tue, 24 Nov 2020 03:50:33 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CgHlc4blhzkdKN; Tue, 24 Nov 2020 16:50:04 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 16:50:21 +0800 From: John Garry To: , CC: , , , John Garry Subject: [PATCH v2 1/3] scsi: hisi_sas: Reduce some indirection in v3 hw driver Date: Tue, 24 Nov 2020 16:46:32 +0800 Message-ID: <1606207594-196362-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1606207594-196362-1-git-send-email-john.garry@huawei.com> References: <1606207594-196362-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Sometimes local functions are called indirectly from the hw driver, which only makes the code harder to follow. Remove these. Method .hw_init is only called from platform driver probe, which is not relevant, so don't set this either. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 7133ca859b5e..db409f6847bb 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -3142,7 +3142,6 @@ static struct scsi_host_template sht_v3_hw = { }; static const struct hisi_sas_hw hisi_sas_v3_hw = { - .hw_init = hisi_sas_v3_init, .setup_itct = setup_itct_v3_hw, .get_wideport_bitmap = get_wideport_bitmap_v3_hw, .complete_hdr_size = sizeof(struct hisi_sas_complete_v3_hdr), @@ -3322,7 +3321,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (rc) goto err_out_register_ha; - rc = hisi_hba->hw->hw_init(hisi_hba); + rc = hisi_sas_v3_init(hisi_hba); if (rc) goto err_out_register_ha; @@ -3511,7 +3510,7 @@ static int _resume_v3_hw(struct device *device) pci_disable_device(pdev); return rc; } - hisi_hba->hw->phys_init(hisi_hba); + phys_init_v3_hw(hisi_hba); sas_resume_ha(sha); clear_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags);