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: 156831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1196026vqx; Mon, 23 Oct 2023 03:28:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIhZnT79sFTN/7ZRamtRF3ypOPT4Ax+iQBGG2tvX8YUoRG73ulM77g8KqA69qylVX2Kd+Q X-Received: by 2002:a05:6871:4391:b0:1bb:a227:7008 with SMTP id lv17-20020a056871439100b001bba2277008mr11165191oab.3.1698056918126; Mon, 23 Oct 2023 03:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698056918; cv=none; d=google.com; s=arc-20160816; b=YIMDLTUbWrpL7egaIYMHs4ZybVNFRfDQp+XL1T6F+/YOogeEQRELozpQZrz2f9sq9j FeyT4po37VYagkf8C7r7j00d0GlzUCmL7CmyRL8v3ZEMvvJrMdjpDrFAdJUzGQPuvsDR E9BBGO83UqXYe3L8/uVhLTJWsm6EKEl42gnXaRWMI3L8ZijQfjcAFmkRJuYoBgNNbBxj QJS8ZS5gseju+VQ2WSBwv2zJgesqsTnk4a45Vr23nqR/25GLMDx9Iy3VJJuDy7B4L6al apwpWuA/1G1UOlRLl4okG5cge3fxndT2zdsfk5s0jQ2ktf5nSiceW0UHD6H1F3O+dQ0w L3JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mmpbmNsgTug//AKJ23/LOrdfKl+bPeYyVbdQxbwryQU=; fh=G8L2xcXcUfTwKgz/64i042sicb517b2gVJa29oGD+44=; b=dgQpmqX6MFhshsuVsjI5Hu0ODaqGLNVyFk0m7ayByxHLkEhmiW/ithlDJB1WPrUylf kcQCBipXmyd+FNO3m1WKoRsKkAkod//6n2Y/W4lT8ssJGdu1uX+oulaONv2SWnSvoi7k YpuGv0jKL/8Tr7SxceuP4OAgjaEBMixQkIP2a58sTn9/Ya5761EvPUELar4WmJZaZxCw KnyF/+UCkVcpHOc73Fg7KotHmeDaXVqX/1IUR6gQvROVd/OF3otiWFkGumrNTcyU98+L OpHRYroNOGmID9Rh1dW1AjpYg7z0Z748Q0eb9zo0OndtTRRohKWAJRU6DRtgrzrkV5HC 6oyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HFMx6Vpk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id w67-20020a636246000000b0058543c16567si6063443pgb.459.2023.10.23.03.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 03:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HFMx6Vpk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0705580A9F3C; Mon, 23 Oct 2023 03:28:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbjJWK2O (ORCPT + 27 others); Mon, 23 Oct 2023 06:28:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjJWK2M (ORCPT ); Mon, 23 Oct 2023 06:28:12 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 281FCDB for ; Mon, 23 Oct 2023 03:28:10 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5079c846dcfso4129692e87.2 for ; Mon, 23 Oct 2023 03:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698056888; x=1698661688; darn=vger.kernel.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=HFMx6Vpk1WYr9L3T+Ehw03LMhD0CTnqfUmzSvs37mL0EqgAq9y309v2/a8jZuWhhrQ RiFPCzf2wDCsIKlComjSU2Ytu5X6XO88yLezkswbJ0pkv27BUv4ivyCvAd5STpsyS/qx fJeyiiK0n+uHhZdMzZYgFTVZbAw/kCnB7lMNuJRJZwqUjatt3VUuDyqcDKjQWexrHZqp 8UCQ4go48Kdayo6osNN21TwWg3FWtyMVqSH99w8UpR9MKsKGczfe1kWtpIzcFxJTWunU 3/3HlAXgRSE820j6E1XpFioF7XNkvdL546JAp1FXM1K2pjqV9rD0udalsteZLL51jCvB zvEA== 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=Z7rvSQLHXRzhzMPlwH4z7adnPTwAIip5hwJDRTKraFLC75s/WiUyvSwAXSJmyaEJB8 jztFynkjM/ZD29q7a6wNHnFmRs1kMNjQEnZ3F6+oNZQoq13z1zzoB9oINSZi0788d+Cr gsIVmMyUyAkxiiuDCWHr2M5Tgsj+51+vS9OiVIb+a3GKHgLRVUEcr1WGe14fEv29wodU mJ0LzBHwc2SETpVDoG/GTC0qZMIvmOti38ISSJUTFvLV+wFTh6NrUEgERQAoOldaJ+54 PqrQTSlfhgbnLn50n463YHw5JlfgYyPFShLazRQw4ZHRIunZGy1ooNZtzSFqPd7gCNZL iWgw== X-Gm-Message-State: AOJu0Yy+kY21A6lPaZ/gK/u6V7PudBREBworCcndFWAkpCwiIvrNo5wl bk91nJFo+96RcivLYc7kNpM= 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-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 03:28:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780541731316843505 X-GMAIL-MSGID: 1780541731316843505 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;