Message ID | 20230807-mtd-flash-info-db-rework-v1-14-3d3d5bef4ba4@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1474781vqr; Mon, 7 Aug 2023 07:06:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUsE+j+csgqpcXxEeWBCIUMtxB/ORXM0v0YlvYjUObq3caRJG3BiWu5kVod5ayScwR2+ZS X-Received: by 2002:a17:90a:dc83:b0:268:5e70:508a with SMTP id j3-20020a17090adc8300b002685e70508amr8180630pjv.43.1691417191746; Mon, 07 Aug 2023 07:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691417191; cv=none; d=google.com; s=arc-20160816; b=YbOASMj8LYQnVgHRGk5J3jky3tnp9JVxuEWs7Qlc7Mv+8j58CzWNZ4iBaiKMu3V9FJ HeHqu6MM/Dcf6CcgH2VLrdXjeqCLlDX2JsHeARgSrnnroLbWHwmyihsqH5jJVyJNZDE4 7DvinFYOPlYvOx+4/nP//WzQMC7bjsPfZtiFgIgtNtU2O0EQ76ZBhCbFGRVYoQHWpRK1 Oqnm0ZqAv6kwYEWoencdUu9yZarEzHv0KAp2NCMDkPAArui2cLl3Ov5mTS/HdJ3KJ7ak dHabVvBeA0BN0luqatoFU8urJ3DWfoQFYuHOiy5HAYYA6iY86NXxX33jx6nYtrc2aoDJ UVTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=UiUF0d8gQWOIt8rdxYnGxw5bMqun18wOaHUrfKpHNEM=; fh=RALaZuXxt5Mu82N5kUELovHA7AaojYeH1mDx6LGdybg=; b=ViMkLp+a90fwRxU8HrOAxCPTDoZ2SZ/05Uv0xrzQcuqyAW3xRFhcVVHaTvqW9OYlCO RV14S/UbyVfAgdpZubqozWjcuM/GDIfb1TZ3Zyt3296trW3AfpNU+jGt5CsGOATY6TRx WL6j6mcES/nN0K7DpMnkbva17A5St/cED/d+jqvHdem2Zc0ZQCArospV+GYhxfBgAsrr 4+7TMwLjGg3fPuwzU0wmAPiTSe7Z8ShJDtNw53ZJF77d3Z/pRTEmbFJPuSi+ldoAU+Sb I1eRR+gYJS25yQa0eV9TVIkICkRlDL52q58cBAf3KCvhgnbME+T676E2iN6d4v59QzQ8 nBzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BLzgVoV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a17090aa58600b00268cdfdf084si119325pjq.80.2023.08.07.07.06.18; Mon, 07 Aug 2023 07:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BLzgVoV9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233969AbjHGNXU (ORCPT <rfc822;aaronkmseo@gmail.com> + 99 others); Mon, 7 Aug 2023 09:23:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234036AbjHGNWv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Aug 2023 09:22:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113CD26A6 for <linux-kernel@vger.kernel.org>; Mon, 7 Aug 2023 06:22:29 -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 DE72261AAC for <linux-kernel@vger.kernel.org>; Mon, 7 Aug 2023 13:22:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E754C433CB; Mon, 7 Aug 2023 13:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691414542; bh=lVNHe40ZD+qOohBgV1PoniWN1QEJCYIZ2y5SGmIv6ik=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BLzgVoV9Kw93tRTL4v19Z6zKs5jepRwI5NdutVFedJCOcVomkJkGqQcv5ZZuEGcpq tAZA5Hsj7rOvIs05mA6Mc8aJXbXQbcQn4iqen6YWw+0QHPj/MZ4Q7RC94kYfLmDjvr iuuHmh+nYiv+fjWriB+GBrumYyjczTn1tkXsWzleUHc9w4Gus0dloarTebDAQRkrwm iarBY1+C3moLn/4kKvx2ZenQdWAN3INCRmy3vzqo3hR8FGWyGv2/gqBt9hMgjjU4ds IqDMppSeQ2Pq9qrx1IiMg0M4LuhuvqdYkGtJJswCjcKnINEeThYCGbJc0lLuDaGx23 PfhPscFx9RMJA== From: Michael Walle <mwalle@kernel.org> Date: Mon, 07 Aug 2023 15:21:08 +0200 Subject: [PATCH 14/41] mtd: spi-nor: rename .otp_org to .otp and make it a pointer MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230807-mtd-flash-info-db-rework-v1-14-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 <tudor.ambarus@linaro.org>, Pratyush Yadav <pratyush@kernel.org>, Michael Walle <michael@walle.cc>, Miquel Raynal <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com> Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Michael Walle <mwalle@kernel.org> X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773579473128916814 X-GMAIL-MSGID: 1773579473128916814 |
Series |
mtd: spi-nor: clean the flash_info database up
|
|
Commit Message
Michael Walle
Aug. 7, 2023, 1:21 p.m. UTC
Move the OTP ops out of the flash_info structure. Besides of saving some
space, there will be a new macro SNOR_OTP() which can be used to set the
ops:
.otp = SNOR_OTP(...),
Signed-off-by: Michael Walle <mwalle@kernel.org>
---
drivers/mtd/spi-nor/core.c | 2 +-
drivers/mtd/spi-nor/core.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1319fcb97e16..06b34d9ad8a1 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2977,7 +2977,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor) struct device_node *np = spi_nor_get_flash_node(nor); params->quad_enable = spi_nor_sr2_bit1_quad_enable; - params->otp.org = &info->otp_org; + params->otp.org = info->otp; /* Default to 16-bit Write Status (01h) Command */ nor->flags |= SNOR_F_HAS_16BIT_SR; diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index 57272bb51eff..e26a17d11c14 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -555,7 +555,7 @@ struct flash_info { u8 mfr_flags; - const struct spi_nor_otp_organization otp_org; + const struct spi_nor_otp_organization *otp; const struct spi_nor_fixups *fixups; }; @@ -605,7 +605,7 @@ struct flash_info { .flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR, \ #define OTP_INFO(_len, _n_regions, _base, _offset) \ - .otp_org = { \ + .otp = &(const struct spi_nor_otp_organization){ \ .len = (_len), \ .base = (_base), \ .offset = (_offset), \