Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2891831pxb; Sun, 15 Nov 2020 22:56:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVDRWa5zPXPHYMD4C85g0JybZg5tAJJQlgsZoR6SUY9Nep2/E8Hucpw5Vhl3kRvJM/EUy7 X-Received: by 2002:a17:906:9719:: with SMTP id k25mr12921385ejx.226.1605509802766; Sun, 15 Nov 2020 22:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605509802; cv=none; d=google.com; s=arc-20160816; b=VoO+aaBVJfTvpQUIGM+l5ypVP4tn8Ktj8MF6af6PN0lXpvjRykq4COyx6/IarVHnBu galc5CPX/xyLMzUxPHEBPhHh5NOX81MOehQrF+bqR2/PYjmJMKXDBUzbuZ6j6ueswzBE SBk1peAwiCc4LGzk6Q/shoZERXbSkpRno/0KwH1e1bjMX8zN7uCL3mgh2VtD/APqPISe 42aU5n4g6SQYRfMeMkEpY5wzmbSs/uOilUX0fnfsMv7zaoX6uPVQc13982zQMmvd+CYQ YEj75F7LmUvPFWxNLbhxcaUP3YsDG2besl3ccSHabxRUMzj1AHo/xjwg/yeia68s4PS5 HrcA== 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=nJD3k0G5iA73jxu1zUCAMJWHX32wvIMEiuAWla2e2/A=; b=MgZBKubit9J7AJ0PhoEKJcb3FwsdpX8LR9M8tYyx/Ee1ENBs7iLMaoF3fY7fJ7zVoo vLynCFS29i3K7giIDOAj4UPEZ2SEMAuNFsnF4SHUn57XsrQcyZIvrnzHYWCh3cT1hQ21 4HbIq0NrE4SbYv15VD5ywyT3kAiqoMsePiR8cHRoQS5nXRfw55gRdoV/tKCJ0U5XS8ff du69UpxXSYCKjJ+0WsyoHFb4/SNzBlEdz7dToRdPG2kN4B+qo1yTQLkOngKYALexr99L OqFXN2LGDAP1w8qN5nPeR32gnnVnbsXIQr0GLm3tz8Iw9JtFmtQgfbnFQ9iupuEdygSq eShw== 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 k6si11023013eds.482.2020.11.15.22.56.19; Sun, 15 Nov 2020 22:56:42 -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 S1727165AbgKPGvA (ORCPT + 99 others); Mon, 16 Nov 2020 01:51:00 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:59498 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726821AbgKPGvA (ORCPT ); Mon, 16 Nov 2020 01:51:00 -0500 X-UUID: c5225fbbdcfb4bed8e9767705d9e44a0-20201116 X-UUID: c5225fbbdcfb4bed8e9767705d9e44a0-20201116 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 2043911849; Mon, 16 Nov 2020 14:50:58 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Nov 2020 14:50:57 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 16 Nov 2020 14:50:57 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v1 9/9] scsi: ufs-qcom: Use common ADAPT configuration function Date: Mon, 16 Nov 2020 14:50:54 +0800 Message-ID: <20201116065054.7658-10-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201116065054.7658-1-stanley.chu@mediatek.com> References: <20201116065054.7658-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 Use common ADAPT configuration function to reduce duplicated code in UFS drivers. Signed-off-by: Stanley Chu --- drivers/scsi/ufs/ufs-qcom.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 04adfbd10753..1e434cce0f79 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -723,17 +723,9 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba, ufs_qcom_dev_ref_clk_ctrl(host, true); if (host->hw_ver.major >= 0x4) { - if (dev_req_params->gear_tx == UFS_HS_G4) { - /* INITIAL ADAPT */ - ufshcd_dme_set(hba, - UIC_ARG_MIB(PA_TXHSADAPTTYPE), - PA_INITIAL_ADAPT); - } else { - /* NO ADAPT */ - ufshcd_dme_set(hba, - UIC_ARG_MIB(PA_TXHSADAPTTYPE), - PA_NO_ADAPT); - } + ufshcd_dme_configure_adapt(hba, + dev_req_params->gear_tx, + PA_INITIAL_ADAPT); } break; case POST_CHANGE: -- 2.18.0