From nobody Wed Dec 17 10:42:39 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 A7F4AEE49A8 for ; Tue, 22 Aug 2023 07:11:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233398AbjHVHLo (ORCPT ); Tue, 22 Aug 2023 03:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233374AbjHVHL2 (ORCPT ); Tue, 22 Aug 2023 03:11:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42C3E1B7 for ; Tue, 22 Aug 2023 00:11:03 -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 E0161637BC for ; Tue, 22 Aug 2023 07:10:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BDAAC433C7; Tue, 22 Aug 2023 07:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692688240; bh=yf+i4Rv/o/8TXBlVhYljTJbV/eUqv5ZZTBjDmCQ4PA0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qKh+Z+JW9aXiTrSnLy2qAMQrDPCSHzFhlHX1NUPDko1ydcEAPeUS/yZX/EhpSrYXH bETWdtNFj2yPM6MJcT2D0/+PL2wbmq91go6N/dNgrHU77JLCGYbX46aiLust2nG48c x3E5v7jAVyz5p6MAQE9vgPhVnHKnTV1WRkH9MkPIBsSjxSOYCa0gZuPa/7QxAcctTA YKej/C6tEeo0V5dqnALnFlYCvSCbE8nc7d9zyOKTPgwb/GsH/Q4rHw6LrBelr7lq18 aLFwRvtrcShCpLiTJuwMkaVU8t7vKoeaiWsXdlM795xwS2hnjthQVkrJHdFV9JxO1P w28370b99WuNA== From: Michael Walle Date: Tue, 22 Aug 2023 09:09:48 +0200 Subject: [PATCH v2 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-v2-32-291a0f39f8d8@kernel.org> References: <20230807-mtd-flash-info-db-rework-v2-0-291a0f39f8d8@kernel.org> In-Reply-To: <20230807-mtd-flash-info-db-rework-v2-0-291a0f39f8d8@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