Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3229563pxu; Tue, 15 Dec 2020 01:43:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHKpdMAU6wofCu5+8TGKKxr/wsWMO3bisM7CM6zQujrUf4CZi7C53onnIST+Et+lmqwXj1 X-Received: by 2002:a17:906:7cc6:: with SMTP id h6mr25567061ejp.161.1608025409150; Tue, 15 Dec 2020 01:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608025409; cv=none; d=google.com; s=arc-20160816; b=okS5mkVspVoeo7sl6suGn/BHTlQtzc+CUaNvhsiKOVbv0h+B2C7Zabozl2acnEbmgi Te6mQoI6u6Uu1hUpHe7MWf6qOOff2RZu8bopHkAuJ19ppJ4UmbWvL7lAgiPnu5VNasps FZjk0AYY9i2FJI+zQrS4BxUWr2O58fm0I1cowc2H/6thGSVwGYnfjNeikSIbQwQj/Ra3 3vVOGev7S2tmkGfCizw4u65i+Ww36dBpi5dDFK/CJamglTxNzAzJ/o8Afw5UoSTR+5gZ rGGmA5+gHNvb9VYRt9en20Ff8eH9Ar5bGKZaPLMC+nLEUxZYqSe+Z4Tx0q5gJVGt9fy7 ahnw== 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=94fvYMoZjgNl0zZ85u9MmQlHmOIq/8hCGf4KXEWKNLg=; b=p1TfUy97FuS+UwDrTKeF0jrtC5v0epda1g6Rv9rCYaH4NbFgnJKt04V24qZ4WnYGde FoyRo3kAZ4jGZjGLqaZrEs78XRuewsmXDBCxsuRQN+4QB6qNArtVZ8HMbSjQcM6F1NFL IdwftJWFwFbrrMBxAWC4LdXz6+OPzuW2w/tCIT7+VaL9zHvvSKkkhiXiZZ5ykM/pxjxC mDvDStunMtensYvyUE7Hqx4HYiz86WkK+LNJl9LUUbPS0JlyfWLiPTaadXnVCVB6jqn3 8UJa6iMjfIEHGEqr1BSHpIlu7H2O3Xe5gDmLIBlQv9Fr+zOkaw1vAazJoC7Ba3v/FBH3 omfA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si627672ejg.14.2020.12.15.01.43.06; Tue, 15 Dec 2020 01:43:29 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728274AbgLOJkl (ORCPT + 99 others); Tue, 15 Dec 2020 04:40:41 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:33782 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728160AbgLOJkY (ORCPT ); Tue, 15 Dec 2020 04:40:24 -0500 X-UUID: fbc6ddef67e84c37a5a154b284793fae-20201215 X-UUID: fbc6ddef67e84c37a5a154b284793fae-20201215 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 473899769; Tue, 15 Dec 2020 17:39:36 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Dec 2020 17:39:36 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 15 Dec 2020 17:39:36 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v1 2/4] scsi: ufs: Cleanup ufshcd_add_lus function Date: Tue, 15 Dec 2020 17:39:32 +0800 Message-ID: <20201215093934.21223-3-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201215093934.21223-1-stanley.chu@mediatek.com> References: <20201215093934.21223-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hba->devfreq is zero-initialized thus it is not required to check its existence in ufshcd_add_lus() function which is invoked during initialization only. Signed-off-by: Stanley Chu --- drivers/scsi/ufs/ufshcd.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index a91b73a1fc48..9cc16598136d 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7636,15 +7636,13 @@ static int ufshcd_add_lus(struct ufs_hba *hba) &hba->pwr_info, sizeof(struct ufs_pa_layer_attr)); hba->clk_scaling.saved_pwr_info.is_valid = true; - if (!hba->devfreq) { - hba->clk_scaling.is_allowed = true; - ret = ufshcd_devfreq_init(hba); - if (ret) - goto out; + hba->clk_scaling.is_allowed = true; + ret = ufshcd_devfreq_init(hba); + if (ret) + goto out; - hba->clk_scaling.is_enabled = true; - ufshcd_clkscaling_init_sysfs(hba); - } + hba->clk_scaling.is_enabled = true; + ufshcd_clkscaling_init_sysfs(hba); } ufs_bsg_probe(hba); -- 2.18.0