From nobody Fri Sep 5 07:57:11 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 31396C001DB for ; Mon, 7 Aug 2023 13:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234135AbjHGNZT (ORCPT ); Mon, 7 Aug 2023 09:25:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234101AbjHGNYl (ORCPT ); Mon, 7 Aug 2023 09:24:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FD7A19AB for ; Mon, 7 Aug 2023 06:23:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E7AF061B06 for ; Mon, 7 Aug 2023 13:23:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A43F3C433C8; Mon, 7 Aug 2023 13:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691414580; bh=yf+i4Rv/o/8TXBlVhYljTJbV/eUqv5ZZTBjDmCQ4PA0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=c7w/2nHMiI1Ih+Msu1UD6s4O38rZIEENrYqf7XuoFBaFf15Fe4+JSOfuKFujzqNm3 A1uGMOVTB+QDlH9TKaLUmev4LBE2nFYOmK8GUlTTyu6rmIstFXbCyn6oh8uUsaf2cM R/65hn4+hV41m5w/416ZA8zHr1Z3ZBl3QH5s1h9AmNcDqyw00EfflTzK3EGgyi7r0q RpRNgQrrdLQCJT8YWwWTfnMm8CNAO8AtBzwhmCOV9drfyEUXWhpsKihRNN0AlcT0X5 DdW+B6CkLJX0liDI1dZUsAkpaF3/yYTTIGIRaoCGj5fk4puaTCFpU2AubQgYbW7tEJ vKe4TutaePmgg== From: Michael Walle Date: Mon, 07 Aug 2023 15:21:26 +0200 Subject: [PATCH 32/41] mtd: spi-nor: eon: sort flash_info database MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230807-mtd-flash-info-db-rework-v1-32-3d3d5bef4ba4@kernel.org> References: <20230807-mtd-flash-info-db-rework-v1-0-3d3d5bef4ba4@kernel.org> In-Reply-To: <20230807-mtd-flash-info-db-rework-v1-0-3d3d5bef4ba4@kernel.org> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle --- drivers/mtd/spi-nor/eon.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/mtd/spi-nor/eon.c b/drivers/mtd/spi-nor/eon.c index ba09cb6c2abd..c1ddf662f782 100644 --- a/drivers/mtd/spi-nor/eon.c +++ b/drivers/mtd/spi-nor/eon.c @@ -10,32 +10,37 @@ =20 static const struct flash_info eon_nor_parts[] =3D { { - .id =3D SNOR_ID(0x1c, 0x31, 0x16), - .name =3D "en25f32", - .size =3D SZ_4M, - .no_sfdp_flags =3D SECT_4K, - }, { .id =3D SNOR_ID(0x1c, 0x20, 0x16), .name =3D "en25p32", .size =3D SZ_4M, - }, { - .id =3D SNOR_ID(0x1c, 0x30, 0x16), - .name =3D "en25q32b", - .size =3D SZ_4M, }, { .id =3D SNOR_ID(0x1c, 0x20, 0x17), .name =3D "en25p64", .size =3D SZ_8M, + }, { + .id =3D SNOR_ID(0x1c, 0x30, 0x14), + .name =3D "en25q80a", + .size =3D SZ_1M, + .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ, + }, { + .id =3D SNOR_ID(0x1c, 0x30, 0x16), + .name =3D "en25q32b", + .size =3D SZ_4M, }, { .id =3D SNOR_ID(0x1c, 0x30, 0x17), .name =3D "en25q64", .size =3D SZ_8M, .no_sfdp_flags =3D SECT_4K, }, { - .id =3D SNOR_ID(0x1c, 0x30, 0x14), - .name =3D "en25q80a", - .size =3D SZ_1M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ, + .id =3D SNOR_ID(0x1c, 0x31, 0x16), + .name =3D "en25f32", + .size =3D SZ_4M, + .no_sfdp_flags =3D SECT_4K, + }, { + .name =3D "en25s64", + .id =3D SNOR_ID(0x1c, 0x38, 0x17), + .size =3D SZ_8M, + .no_sfdp_flags =3D SECT_4K, }, { .id =3D SNOR_ID(0x1c, 0x70, 0x15), .name =3D "en25qh16", @@ -57,11 +62,6 @@ static const struct flash_info eon_nor_parts[] =3D { }, { .id =3D SNOR_ID(0x1c, 0x70, 0x19), .name =3D "en25qh256", - }, { - .name =3D "en25s64", - .id =3D SNOR_ID(0x1c, 0x38, 0x17), - .size =3D SZ_8M, - .no_sfdp_flags =3D SECT_4K, }, }; =20 --=20 2.39.2