Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10554071pxu; Wed, 30 Dec 2020 05:47:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbQ1+O3u/fZYVM18jLKMXuT3zP7JBNqj6PSisC25ewf19V1ShumjiCyGlVKPrHf9qT+MhB X-Received: by 2002:a17:906:e94c:: with SMTP id jw12mr50841858ejb.56.1609336065041; Wed, 30 Dec 2020 05:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609336065; cv=none; d=google.com; s=arc-20160816; b=HfnkEzY64OX43YkaA9z1uJ9C58ikzhr/2l6Sne4lijz6yNphJHbGyVCFe5Um/CQXoZ 6wgikUYK5CO9QKq/oZrxWefxkfrNrrgBN0UcLHyWPBADTuht8rRPaLciflnfslfgVU8v 7E0DaptqAx8Fe4KVf7QuVVtXLo9lJ9ZZQrBLtPxYDoAtgtRzL9+DTnKIiR5uBxf3hOzO WnGywpzUNFvBLk20SBY7x9vlwE8OEDkGt5H6vxFPariir0tvCR/ss8itdk4VoYh4bB8B 7mZ4lUumt009N+GgYYk+mxpHzMnOkWL7aBFHjcICZYhZf7IP7Tx+hbp8ClVUir18CFzg 94WA== 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:from:references :cc:to:subject; bh=jezTbKQZcFT2YQb8BxqwjWJPOc7KjfDG+xBWyMHBRB4=; b=xjt7yzg1x666daAzuc+1lTTeLby+70EyY2T+qDXuad3STGIzqLTMk1FT4b1n3/Ryku ZP5gtVuyiiwsrLQPewZvvVfLxNWQZZaMqOGNgnTL4N4bFAmauR8j+knsftI2K+beZiN2 Hl6hMlIcZxnrY0AkxuY1wkw1CtIyYaAG0mRrQ/6cXfd8bqjG+70qrsBmuJbkcCJq5VMn 3rJhvGu5sZlyhBawlPccEF/hm3PyQqFeFZnJkSDVpvr3PuctFVCOOcCx+PYJXVs/O13q e8dlYoauELbGwsbevsisfFludN7nE+4wsWpMLqHeRWh55zfHyho3WEBUjDGoNiQx3VDY snlw== 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 q4si23616391edn.338.2020.12.30.05.47.21; Wed, 30 Dec 2020 05:47:45 -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 S1727055AbgL3NoW (ORCPT + 99 others); Wed, 30 Dec 2020 08:44:22 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:57967 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726412AbgL3NoV (ORCPT ); Wed, 30 Dec 2020 08:44:21 -0500 Received: from [192.168.1.25] (unknown [78.193.40.249]) (Authenticated sender: kamel.bouhara@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id CD3D2200002; Wed, 30 Dec 2020 13:43:38 +0000 (UTC) Subject: Re: [PATCH v3 2/2] nvmem: core: skip nodes with compatibles other than "nvmem-cell" To: Ahmad Fatoum , 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> From: Kamel Bouhara Message-ID: Date: Wed, 30 Dec 2020 14:43:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200428111829.2215-3-a.fatoum@pengutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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); > -- Kamel Bouhara, Bootlin Embedded Linux and kernel engineering https://bootlin.com