From nobody Wed Sep 17 21:06:58 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3A87C4332F for ; Thu, 15 Dec 2022 16:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229506AbiLOQkL (ORCPT ); Thu, 15 Dec 2022 11:40:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbiLOQj5 (ORCPT ); Thu, 15 Dec 2022 11:39:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B272D20F5A for ; Thu, 15 Dec 2022 08:39:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4DCDE61E41 for ; Thu, 15 Dec 2022 16:39:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 272BFC433D2; Thu, 15 Dec 2022 16:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671122395; bh=pP6atf/tM5bifszUgRPBT2KCcUTS6tZpd3asUA7oItQ=; h=From:To:Cc:Subject:Date:From; b=m9sWbQngPK1fyTuHc3qwtSaoLjAT/wbKhmLExrAaSjv9dK3hcndZIwBXuQTjKQukg wS5t9ZQhKggRG5X4kl41YFzYX+2hDijJWsqFPYyb92wVKWu3KJ/ybq1oul/gFnZI1I FsOpUcQ116SxQNJ5UfUTxUrrYAhcTqlwqTIk/rulUDB4nmdXwMWk9eaNY/1kVVrnRU LDpHuhDgq114nlLtSC8iH5nVhtxDLPl0dnfCSlnXCF+sr/DZ5Ip86m5wNwRFQZ4J84 kKE2mpBKS2fYFI3GRaPKlzCc3NOxgSO878XYHHZdjahz++7qy9449AlXX4HzLCixPS cayMZ8pSdiiRQ== From: Arnd Bergmann To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Arnd Bergmann , Tokunori Ikegami , Lee Jones , Mauro Lima , Tudor Ambarus , Mika Westerberg , Boris Brezillon , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] mtd: cfi: allow building spi-intel standalone Date: Thu, 15 Dec 2022 17:39:38 +0100 Message-Id: <20221215163950.649791-1-arnd@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann When MTD or MTD_CFI_GEOMETRY is disabled, the spi-intel driver fails to build, as it includes the shared CFI header: include/linux/mtd/cfi.h:62:2: error: #warning No CONFIG_MTD_CFI_Ix selected= . No NOR chip support can work. [-Werror=3Dcpp] 62 | #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can wor= k. Use an #ifdef here to guard the settings so the header can be included in all configurations. Fixes: e23e5a05d1fd ("mtd: spi-nor: intel-spi: Convert to SPI MEM") Signed-off-by: Arnd Bergmann Reviewed-by: Mika Westerberg --- include/linux/mtd/cfi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index d88bb56c18e2..0e87b6e2faad 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -15,6 +15,7 @@ #include #include =20 +#if IS_ENABLED(CONFIG_MTD) #ifdef CONFIG_MTD_CFI_I1 #define cfi_interleave(cfi) 1 #define cfi_interleave_is_1(cfi) (cfi_interleave(cfi) =3D=3D 1) @@ -88,7 +89,7 @@ static inline int cfi_interleave_supported(int i) return 0; } } - +#endif =20 /* NB: these values must represents the number of bytes needed to meet the * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes. --=20 2.35.1