Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1989096pxb; Mon, 18 Jan 2021 05:32:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyz7JSc5RLz4YYboXzHKQBYxmyHQ7/rjwU8dKQtvkznOJFj5IX/565Qk3oRZ0TRL1JmmHBD X-Received: by 2002:a17:906:26ca:: with SMTP id u10mr17489639ejc.165.1610976743893; Mon, 18 Jan 2021 05:32:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610976743; cv=none; d=google.com; s=arc-20160816; b=eVgxLbiN9VAxY5dSSqlP1QHempyCS5OWb4XEkqa6HjCjt2nvZES5ruj8Mq1UGqqKWX bjn/gm0gIt4BpxI4L5ltz+54V/6KEa4ZjR+VCGK5AXWjeZe+UKER2H4x1aENpDb0fJjP fvvhgUTlt1zaDDVCz/h/2x20qqAFu0cRKV0CATYJFi4Mba649qn/RLYUVr7UCnHlR3Zk NJpoRs8mkF6UCA9VF/dIqTve83O1Jyn1AG9N7JVO4ykD81W/stctpx90NDanNgKkWZhG 6NZAhgFui48KWJ6w06TjlyPwHSsF/YVvj0UQPc9E4S0v/I5azPysr0kukClu3qtol+qj s0yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from; bh=7kT350v1c5/KzWj2pBVzMtep66DoNYnm4IF77QYnL54=; b=ODiY0vrJ7vavmnxNsPmIfhF36cAgt1UECxXaRRwWxffQP/97dnxECzsUtaKoBTaWO5 qbd1epxw08ekTWa3wSz787V3bKB8TkiAB90zWubrw078PBI5nF0SMJHAzvwwe6PpuaQs GjuGsdeIU5jNeDYQN8Lg/L/iFVs1czsUqFKNxpAmMf2w9v1zesVIoG6KfH4Q89tT++2v 7OLHk5jzNg2joLRkXzyNnpOUP4qIpfHHhiiP+u+dPXPSJHkP6BmmJl+RcuozZKuyZg9g U2ZIqNB/Dz/xpjuWHKPBNOetaCzTzFilwwYNRsdkZ3FNRRvFQ13x2knfRlw24aX6a7cc DirQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d27si1821134ejt.58.2021.01.18.05.32.00; Mon, 18 Jan 2021 05:32:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404602AbhARN0y (ORCPT + 99 others); Mon, 18 Jan 2021 08:26:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404561AbhARNZ6 (ORCPT ); Mon, 18 Jan 2021 08:25:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4404DC061575 for ; Mon, 18 Jan 2021 05:25:18 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1l1UWy-0000Re-Lc; Mon, 18 Jan 2021 14:25:16 +0100 From: Ahmad Fatoum Subject: Re: [PATCH v3 2/2] nvmem: core: skip nodes with compatibles other than "nvmem-cell" To: Kamel Bouhara , Srinivas Kandagatla Cc: kernel@pengutronix.de, ceggers@arri.de, linux-kernel@vger.kernel.org References: <20200428111829.2215-1-a.fatoum@pengutronix.de> <20200428111829.2215-3-a.fatoum@pengutronix.de> Message-ID: Date: Mon, 18 Jan 2021 14:25:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Kamel, On 30.12.20 14:43, Kamel Bouhara wrote: > Hi Ahmad, > > On 4/28/20 1:18 PM, Ahmad Fatoum wrote: >> The nvmem cell binding used to apply to all objects which match >> "^.*@[0-9a-f]+$", without taking a compatible into account, which >> precluded extension of EEPROMs by child nodes other than nvmem. >> >> A previous commit changed the binding, so that nvmem cells that >> feature a compatible property must have "nvmem-cell" as the value, >> otherwise they are skipped. >> >> Adjust the driver to observe the new binding change. This change >> does not change behavior for any device tree that was already >> compliant with the nvmem binding. >> >> Signed-off-by: Ahmad Fatoum > > Tested-by: Kamel Bouhara Thanks for testing. Could you share what use case you have for this? Rob had objections to this approach: https://lore.kernel.org/linux-devicetree/20200512141834.GA3023@bogus/ But solving it within a partition doesn't address my original problem: https://lore.kernel.org/lkml/f03ecee7-c4b6-7a59-7ab8-42c5dfcaffc4@pengutronix.de/ I just sent out a v4, which added you in CC. Cheers, Ahmad > >> --- >>   drivers/nvmem/core.c | 4 ++++ >>   1 file changed, 4 insertions(+) >> >> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c >> index 05c6ae4b0b97..eb697f5ad07d 100644 >> --- a/drivers/nvmem/core.c >> +++ b/drivers/nvmem/core.c >> @@ -547,6 +547,10 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) >>       parent = dev->of_node; >>         for_each_child_of_node(parent, child) { >> +        if (of_find_property(child, "compatible", NULL) && >> +            !of_device_is_compatible(child, "nvmem-cell")) >> +            continue; >> + >>           addr = of_get_property(child, "reg", &len); >>           if (!addr || (len < 2 * sizeof(u32))) { >>               dev_err(dev, "nvmem: invalid reg on %pOF\n", child); >> > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |