Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp288034pxt; Fri, 6 Aug 2021 01:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeFJhRxcBGdc8jTOYjloFssdJ6bAXtxM98zE9NMeURNQBz9Iherv0tdjDuk88KcTVHMcJ6 X-Received: by 2002:aa7:d691:: with SMTP id d17mr11633756edr.245.1628240252780; Fri, 06 Aug 2021 01:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628240252; cv=none; d=google.com; s=arc-20160816; b=l0K8mk+d3fMTgSsbT0OH66gsOPNjcMN43yMXlcwIWc2gdpFAGPULRUG1H+SgWItBxu d7b3pRL1JRXDbrg3LLj4m4SQodWL+QzIzzAV46yS5MZBWzRzxWEJGSVutufiQXfkYLN1 LEl+sXgryoXMFSfokHTB52YtTArlQjCDGL6/AlYq8ojsnXZDyRIT6e3KYV93xcX6wYB2 WLA44e4DpC587b1OJZ31EFhZibLnspt8160O5WJ9S/my0Qlctuwp3pQJICWzAZvh3P94 3OouGUCyqWTIF+jas0knmWAXexWS/GOPgbqpmJ2ndxTIL8y+l+GRQERmxdEY3/IEIciF zhmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:content-transfer-encoding:date :message-id:to:from:sender:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=MQQTApWByV9FXOfpNZN2RjbAliwdWlY4BO3NC3rYsCw=; b=m5BX75ACxLdjuc/vv4DiBoynw3tT6YY5gqQtyebnTVQt6kenw3vE9Bh2WpwpxCnTgB HzYZeXES6NJfP27+pYadOLPi1AUdszEYAQJAt89WjDeNVXIqtzl0d9V1kKp5x2HBoq7h txLvZ47KzihILsvKH2bSkqGHu+yPnejG2bDQQpaw8vBe8Z2h5JJxGSOUSOAN300QDVNM fR3oujKiv7RJktKt7kBb8MoDGnutH1OpynjYH75mUNZZHdBjAtjpep0KHDs6qnL1szu7 nm0KUbI8OQwYXVIw+XZ+FyZ9aQavkn8T1SFxuPlPeK9TIbCJ5a6xTWGwInuTk8do35+M JhXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Tl1B3UCk; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si8151081edr.107.2021.08.06.01.57.09; Fri, 06 Aug 2021 01:57:32 -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=@samsung.com header.s=mail20170921 header.b=Tl1B3UCk; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243788AbhHFIzW (ORCPT + 99 others); Fri, 6 Aug 2021 04:55:22 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:54681 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243794AbhHFIzT (ORCPT ); Fri, 6 Aug 2021 04:55:19 -0400 Received: from epcas3p3.samsung.com (unknown [182.195.41.21]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210806085502epoutp03afcda46a551952ffe214e8349cb4b39c~Yq78kYcWn1987019870epoutp039 for ; Fri, 6 Aug 2021 08:55:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210806085502epoutp03afcda46a551952ffe214e8349cb4b39c~Yq78kYcWn1987019870epoutp039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1628240102; bh=MQQTApWByV9FXOfpNZN2RjbAliwdWlY4BO3NC3rYsCw=; h=Subject:Reply-To:From:To:Date:References:From; b=Tl1B3UCkElSaEVsNsfCEIoml4TRlx9wmnV0qOKPrBcEDD6kE2Pn4eUWsXMflSQaJC i86GZPa9uAEli7O7kM1cdAynb/97u3AKK92BLAxjxudT0crQhKfvA+we4pP48uDF3H K/3v9jfav+BEBHYwj2Z6+YmGg7O9Y7VL3nZbt+iQ= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas3p3.samsung.com (KnoxPortal) with ESMTP id 20210806085502epcas3p36b78fd63c9d9c0c1d670ba1f240ba930~Yq78JTwEs0051900519epcas3p3B; Fri, 6 Aug 2021 08:55:02 +0000 (GMT) Received: from epcpadp3 (unknown [182.195.40.17]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Ggznf1bk2z4x9QF; Fri, 6 Aug 2021 08:55:02 +0000 (GMT) Mime-Version: 1.0 Subject: [PATCH] scsi: ufs: Remove ufshcd_variant_hba_init/exit() Reply-To: keosung.park@samsung.com Sender: Keoseong Park From: Keoseong Park To: ALIM AKHTAR , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "cang@codeaurora.org" , "stanley.chu@mediatek.com" , "beanhuo@micron.com" , "jaegeuk@kernel.org" , "adrian.hunter@intel.com" , "asutoshd@codeaurora.org" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <1891546521.01628240102206.JavaMail.epsvc@epcpadp3> Date: Fri, 06 Aug 2021 17:33:44 +0900 X-CMS-MailID: 20210806083344epcms2p1fd38026d07cd74438b4aa2bbd95c3f20 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20210806083344epcms2p1fd38026d07cd74438b4aa2bbd95c3f20 References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since hba->vops is checked in ufshcd_vops_init/exit(), there is no need to check whether hba->vops is NULL in ufshcd_variant_hba_init/exit(). ufshcd_variant_hba_init/exit() has only one caller and only calls vops, so it was removed. Signed-off-by: Keoseong Park --- drivers/scsi/ufs/ufshcd.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 05495c34a2b7..f1bd074627ff 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8438,29 +8438,6 @@ static int ufshcd_init_clocks(struct ufs_hba *hba) return ret; } -static int ufshcd_variant_hba_init(struct ufs_hba *hba) -{ - int err = 0; - - if (!hba->vops) - goto out; - - err = ufshcd_vops_init(hba); - if (err) - dev_err(hba->dev, "%s: variant %s init failed err %d\n", - __func__, ufshcd_get_var_name(hba), err); -out: - return err; -} - -static void ufshcd_variant_hba_exit(struct ufs_hba *hba) -{ - if (!hba->vops) - return; - - ufshcd_vops_exit(hba); -} - static int ufshcd_hba_init(struct ufs_hba *hba) { int err; @@ -8496,9 +8473,12 @@ static int ufshcd_hba_init(struct ufs_hba *hba) if (err) goto out_disable_clks; - err = ufshcd_variant_hba_init(hba); - if (err) + err = ufshcd_vops_init(hba); + if (err) { + dev_err(hba->dev, "%s: variant %s init failed err %d\n", + __func__, ufshcd_get_var_name(hba), err); goto out_disable_vreg; + } ufs_debugfs_hba_init(hba); @@ -8523,7 +8503,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba) if (hba->eh_wq) destroy_workqueue(hba->eh_wq); ufs_debugfs_hba_exit(hba); - ufshcd_variant_hba_exit(hba); + ufshcd_vops_exit(hba); ufshcd_setup_vreg(hba, false); ufshcd_setup_clocks(hba, false); ufshcd_setup_hba_vreg(hba, false); -- 2.17.1