From patchwork Mon Oct 23 10:27:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1853652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EeP2pCe8; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=m1BJsPXX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SDWd10cysz23jn for ; Mon, 23 Oct 2023 21:28:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UT67thRDZVi2y114eFSrJifeu06T8VTGg/bIEX1GvHM=; b=EeP2pCe8BUxHbN Cxnb8vxqqKhy2/9ae6dRQEiNbC3G7ETz4JmwD5VRUDQ22rwmFJShS6Y9xUKcxygUNGNCNkUcjUmDC QlMb5zXlQwMnEVwwVxbWe57TYAaErXc8nLixTmrq6n2csvCfsndC/LGAkA/wBbKwBvHv2aSd1Au8z ejKP+z+2vuC2wlDjp7/f8eHzW5ARxXMtFpNAuc72OmLC/qZooF5lp9nnloRtIqnfaj8Z37meOxNje jn3EB5DZWWgYGvTTl9JU4dNMx8gvcLE6/JbZcTvVotTR6/K49i4P0zfwfmG9sNIc/lOVoZFpAUNu4 9+3tAr+aLtHovH2arXcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qusAP-0071k4-0W; Mon, 23 Oct 2023 10:28:13 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qusAM-0071jd-2j for linux-mtd@lists.infradead.org; Mon, 23 Oct 2023 10:28:12 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5079c846dcfso4129693e87.2 for ; Mon, 23 Oct 2023 03:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698056888; x=1698661688; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mmpbmNsgTug//AKJ23/LOrdfKl+bPeYyVbdQxbwryQU=; b=m1BJsPXXP8yzhEVrQpp0+M7Dhyz+fVlueJftvRtvgIJtvQx9UdJgCb+rRYrhEJRzw3 Kpq6aXW4amSEgkvFbq2yUrYvunhU67Hd7UhnS5MxW+8cfHX45GDzB3Qua9IIUIUIK/B5 6KiTvpy5eSXHsPkmVFrvjzwIC4nH6m1TjAgizEPzna/8vcnoZM8ccfn5pwUb8ffnLnOC loTY2Gn9XVUGh1iVGrD4YGaYwD5SuiCWWFC8vpIV/7TwSc3vWaSYGVsJNnOk5CsMhAIB m7RIqApSfZgpcz3li+0DgCaEO8OnrvSDJpz1i3D3iRrNH7K3cF5vz5CrvKr2q5NI/rxV o2uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698056888; x=1698661688; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mmpbmNsgTug//AKJ23/LOrdfKl+bPeYyVbdQxbwryQU=; b=Mg10akR7gD2p9XNq+Xu4clQkx+v6Bqd0aTBmLVPoE2mFe/MuZIqk4buXOxdmU7pZ4g Zsl/Cq0+C/3vI4OFQUOy3grQ+r9mfYyzgPH5Jg41Hk50j9B9QXYu+kYRqvovrqoOSd5r fqTn5Fjeii5MP6Uicyj7Um7yKMtHDm1oXj2vimQ+wrP9tuPdH9ZkwvxD739cCh8jU83R lbjy+N66HwrjY3uiRybWq3At5Y78g6K0cZY4zoSdEDSMiYifJplar4s13PwWWs705VhJ YXl2TbVOCRCfRPZXNabQtmbMM2Y5EZybHlrcaDyLEhz532R2Dz2GT7z++3DoJxIp2eA2 MoqQ== X-Gm-Message-State: AOJu0Yw6WONkqHt19yIfjhkCfCR7apB1xuVuQ0xn88xBjAJDJ1ZrpVKL SDdzQ8nIPEP6BDHoq8Zft9c= X-Google-Smtp-Source: AGHT+IEk0BIT4qm3w/hQKen9lE10v/DCqP0PmAupQ7uBGK9Pymywqj0AQFZw/jvACh9HlLsqd5RW6w== X-Received: by 2002:ac2:5456:0:b0:507:b074:ecd4 with SMTP id d22-20020ac25456000000b00507b074ecd4mr5594571lfn.7.1698056888098; Mon, 23 Oct 2023 03:28:08 -0700 (PDT) Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id o13-20020ac24bcd000000b00507a622184dsm1651629lfq.173.2023.10.23.03.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 03:28:07 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Greg Kroah-Hartman , Srinivas Kandagatla Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?b?UmFm?= =?utf-8?b?YcWCIE1pxYJlY2tp?= Subject: [PATCH reworded] Revert "nvmem: add new config option" Date: Mon, 23 Oct 2023 12:27:59 +0200 Message-Id: <20231023102759.31529-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231023_032810_889237_8B5A0D33 X-CRM114-Status: GOOD ( 17.85 ) X-Spam-Score: 0.1 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_This_r?= =?unknown-8bit?q?everts_commit_517f14d9cf3533d5ab4fded195ab6f80a92e378f=2E?= =?unknown-8bit?q?_Config_option_=22no=5Fof=5Fnode=22_is_no_longer_needed_sin?= =?unknown-8bit?q?ce_adding_a_more_explicit?= =?unknown-8bit?q?_and_targeted_option_=22add=5Flegacy=5Ffixed=5Fof=5Fcells?= =?unknown-8bit?q?=22=2E_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E1_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C?= =?unknown-8bit?q?_no_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDoxMmQgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail?= =?unknown-8bit?q?_provider?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends?= =?unknown-8bit?q?_in_digit?= =?unknown-8bit?q?_=5Bzajec5=5Bat=5Dgmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_author=27s_domain?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Rafał Miłecki This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. Config option "no_of_node" is no longer needed since adding a more explicit and targeted option "add_legacy_fixed_of_cells". That "no_of_node" config option was needed *earlier* to help mtd's case. DT nodes of MTD partitions (that are also NVMEM devices) may contain subnodes. Those SHOULD NOT be treated as NVMEM fixed cells. To prevent NVMEM core code from parsing subnodes a "no_of_node" option was added (and set to true in mtd) to make for_each_child_of_node() in NVMEM a no-op. That was a bit hacky because it was messing with "of_node" pointer to achieve some side-effect. With the introduction of "add_legacy_fixed_of_cells" config option things got more explicit. MTD subsystem simply tells NVMEM when to look for fixed cells and there is no need to hack "of_node" pointer anymore. Signed-off-by: Rafał Miłecki Reviewed-by: Miquel Raynal Signed-off-by: Srinivas Kandagatla --- Greg: I reworded this PATCH's commit message. It's hopefully clear now that this revert is OK only with the "add_legacy_fixed_of_cells". --- drivers/mtd/mtdcore.c | 1 - drivers/nvmem/core.c | 2 +- include/linux/nvmem-provider.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 320d8ad2babe..bb0759ca12f1 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -560,7 +560,6 @@ static int mtd_nvmem_add(struct mtd_info *mtd) config.read_only = true; config.root_only = true; config.ignore_wp = true; - config.no_of_node = !of_device_is_compatible(node, "nvmem-cells"); config.priv = mtd; mtd->nvmem = nvmem_register(&config); diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 2710943f53c4..bf42b7e826db 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -935,7 +935,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->nkeepout = config->nkeepout; if (config->of_node) nvmem->dev.of_node = config->of_node; - else if (!config->no_of_node) + else nvmem->dev.of_node = config->dev->of_node; switch (config->id) { diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 1b81adebdb8b..e3930835235b 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -89,7 +89,6 @@ struct nvmem_cell_info { * @read_only: Device is read-only. * @root_only: Device is accessibly to root only. * @of_node: If given, this will be used instead of the parent's of_node. - * @no_of_node: Device should not use the parent's of_node even if it's !NULL. * @reg_read: Callback to read data. * @reg_write: Callback to write data. * @size: Device size. @@ -122,7 +121,6 @@ struct nvmem_config { bool ignore_wp; struct nvmem_layout *layout; struct device_node *of_node; - bool no_of_node; nvmem_reg_read_t reg_read; nvmem_reg_write_t reg_write; int size;