Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1921682ybi; Thu, 20 Jun 2019 06:14:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkiJiNq82iPRMzcqD0AU4HbmOuHUAEdajXkC1nzJY4efHuQLWknSkraQHYC0hptjccuEW+ X-Received: by 2002:a17:902:748c:: with SMTP id h12mr12089079pll.208.1561036465810; Thu, 20 Jun 2019 06:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561036465; cv=none; d=google.com; s=arc-20160816; b=fzG2fMbLHyQTWex6e8INI0hp009i1HPy0jHFfJF8JCYgGICJ8BokczS2ksB6GO7/tY JM1s/dMUQyiEkU7aIXlVwFQUjIdZzygobBUE/WQM4Sy/EGtRRWeNHPbf3i99HIRa53lh eYc8aMKRTvDiGuYUXTNBSjN5yG/EL9u2XI6mkUl45JV8MfCK91m+tzJL1pw13cAt31mI cfDJBM5LZ682wag/NNa1HJjJPxKqK+D547VPQ0HJ2E0yBvfl33og0bppMD+x31ywWwZ9 6eA1jt+MIoUSW16lwCaZE4y/rxlqG3o42aIXhzfR1ewZSkt7l1uFKKfOyYeXcRK94qEI 13qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=AqEt1HjWRKgGGIYLNysj/iOUGva1/k0fnnA1DQfj/Nc=; b=wcZVAeZdlLtO45XprMz9H+2MzNFpmy6MdyPKT5UPEAJg75WfCy9c/eeeV1CQ7qfqc8 Gl5JkuBeCWM6lGLpoCEO2/Ey54zUFLv6TOKjZ6e8jGdv0FniRm6FnqrvsEqOhCNRYDvi AKyuWkttto+pHGR4nfa11/YRnPgwDRLoA5FKVgeT9YX76UibruJtfFgwuJey5QeUCppw yMt2rHSNh/GHwLfRjE3SS8bOhgO+8sstfa2bkPPavWmpm6RpplYK9nDaxiR5OwCSFky2 TBvsL3HWlJKzUEXT9THf+5E+njGj4bBi7Wf0ooUWFMM63TAV8X8Zihck9QHsUDuWUy2E gCRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=1i2iITqj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6si4203504pjr.100.2019.06.20.06.14.09; Thu, 20 Jun 2019 06:14:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=1i2iITqj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731926AbfFTNOF (ORCPT + 99 others); Thu, 20 Jun 2019 09:14:05 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:19924 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726952AbfFTNOE (ORCPT ); Thu, 20 Jun 2019 09:14:04 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5KD6pbC021627; Thu, 20 Jun 2019 15:13:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=AqEt1HjWRKgGGIYLNysj/iOUGva1/k0fnnA1DQfj/Nc=; b=1i2iITqjSzxjPDA0v34j1gyK2boQJeVzaXxp+3wBomDQ3gQiYTCFRnctwfbFI4hR7YO3 ZabYwttKVrPzJ0COcQfryFixiLRLA7qvHsMT1LROqmgrPg1+QYAc9uEEkIIzSvvIxrXe VWA88QCqoUODGiKSlccTHZp8WEyR+Wh8vce4WBxoKn6ANShoXgSFeGGv3MbGlVA1JJ3j JuK1mx5iBqhoBEtg8ng2Pf6Z7/2JkcOka3Ncrc9E614228EYHyTJSKjy+ADBxfQK0lu0 g3r9CUxF74F+pRGz7NyLXjzUI+PLXlAD4TeCNwnV2aVZJInur0W44tAM21BxACrkAEC1 Sw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t7813hq5j-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 20 Jun 2019 15:13:52 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2F58B38; Thu, 20 Jun 2019 13:13:51 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 16B4E27F7; Thu, 20 Jun 2019 13:13:51 +0000 (GMT) Received: from localhost (10.75.127.45) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 20 Jun 2019 15:13:50 +0200 From: To: Mark Brown , Maxime Coquelin , Alexandre Torgue , , , , CC: , Subject: [PATCH 1/1] spi: spi-stm32-qspi: Remove CR_FTHRES_MASK usage Date: Thu, 20 Jun 2019 15:13:23 +0200 Message-ID: <20190620131323.5955-1-patrice.chotard@st.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG7NODE1.st.com (10.75.127.19) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-20_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Patrice Chotard On STM32 F4/F7/H7 SoCs, FTHRES is a 5 bits field in QSPI_CR register, but for STM32MP1 SoCs, FTHRES is a 4 bits field long. CR_FTHRES_MASK definition is not correct. As for all these SoCs, FTHRES field is set to 3, FIELD_PREP() macro is used with a constant as second parameter which make its usage useless. CR_FTHRES_MASK and FIELD_PREP() can be removed. Signed-off-by: Patrice Chotard --- drivers/spi/spi-stm32-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c index 42f8e3c6aa1f..5dbb6a8e893c 100644 --- a/drivers/spi/spi-stm32-qspi.c +++ b/drivers/spi/spi-stm32-qspi.c @@ -29,7 +29,7 @@ #define CR_SSHIFT BIT(4) #define CR_DFM BIT(6) #define CR_FSEL BIT(7) -#define CR_FTHRES_MASK GENMASK(12, 8) +#define CR_FTHRES_SHIFT 8 #define CR_TEIE BIT(16) #define CR_TCIE BIT(17) #define CR_FTIE BIT(18) @@ -463,7 +463,7 @@ static int stm32_qspi_setup(struct spi_device *spi) flash->presc = presc; mutex_lock(&qspi->lock); - qspi->cr_reg = FIELD_PREP(CR_FTHRES_MASK, 3) | CR_SSHIFT | CR_EN; + qspi->cr_reg = 3 << CR_FTHRES_SHIFT | CR_SSHIFT | CR_EN; writel_relaxed(qspi->cr_reg, qspi->io_base + QSPI_CR); /* set dcr fsize to max address */ -- 2.17.1