From nobody Mon Sep 8 07:55:26 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 EC46FEE57EB for ; Fri, 8 Sep 2023 10:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243127AbjIHK3D (ORCPT ); Fri, 8 Sep 2023 06:29:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243046AbjIHK25 (ORCPT ); Fri, 8 Sep 2023 06:28:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A9FC211E for ; Fri, 8 Sep 2023 03:28:26 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 561A5C433CB; Fri, 8 Sep 2023 10:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694168257; bh=yf+i4Rv/o/8TXBlVhYljTJbV/eUqv5ZZTBjDmCQ4PA0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PxOw24D6l/ljwy+toiqvno/4y3Cv5dYLakRCHcn5yzMUAyRyEungolKFkqr4y+KOO j6NBMP8Fi4KHk8u5Z4qK48TKM6xoUxhUqNk3mHxS8aauW6laOSMpvqlaLa62ZjulRh k/DHsi63LEPkL1TMiF6umZngnRo1ed8ZVlQF1QL4SA8h79++zwrL6NQ0VEbDWSWl9s Zb1aAt2E3CtAJ+rAquoRMN18dtHJDh+oGh6Y3lorKyYpTSoDYBFsCqA1eQTSkmJB5f YVcn2lk3rKS0RKRKxr+A7Hr4JGCXVNwNrwojTqsEoUDXEdR453zsuyltKHNkRaukER EOpLNb9lpJ7eQ== From: Michael Walle Date: Fri, 08 Sep 2023 12:16:50 +0200 Subject: [PATCH v3 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-v3-32-e60548861b10@kernel.org> References: <20230807-mtd-flash-info-db-rework-v3-0-e60548861b10@kernel.org> In-Reply-To: <20230807-mtd-flash-info-db-rework-v3-0-e60548861b10@kernel.org> To: Tudor Ambarus , Pratyush Yadav , 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