All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamel Bouhara <kamel.bouhara@bootlin.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: kernel@pengutronix.de, ceggers@arri.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] nvmem: core: skip nodes with compatibles other than "nvmem-cell"
Date: Wed, 30 Dec 2020 14:43:38 +0100	[thread overview]
Message-ID: <ee29ed40-a665-2b78-4049-506b718094bf@bootlin.com> (raw)
In-Reply-To: <20200428111829.2215-3-a.fatoum@pengutronix.de>

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 <a.fatoum@pengutronix.de>

Tested-by: Kamel Bouhara <kamel.bouhara@bootlin.com>

> ---
>   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

  parent reply	other threads:[~2020-12-30 13:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 11:18 [PATCH v3 0/2] nvmem: skip nodes with compatibles other than "nvmem-cell" Ahmad Fatoum
2020-04-28 11:18 ` [PATCH v3 1/2] dt-bindings: " Ahmad Fatoum
2020-05-08  6:56   ` Ahmad Fatoum
2020-04-28 11:18 ` [PATCH v3 2/2] nvmem: core: " Ahmad Fatoum
2020-05-11 11:33   ` Srinivas Kandagatla
2020-12-30 13:43   ` Kamel Bouhara [this message]
2021-01-18 13:25     ` Ahmad Fatoum
2020-05-12 14:18 ` [PATCH v3 0/2] nvmem: " Rob Herring
2020-10-12 15:36   ` Ahmad Fatoum
2020-11-02 15:23     ` Ahmad Fatoum
2020-11-16 17:04       ` Ahmad Fatoum
2020-11-16 17:21         ` Srinivas Kandagatla
2020-11-16 17:28           ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee29ed40-a665-2b78-4049-506b718094bf@bootlin.com \
    --to=kamel.bouhara@bootlin.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=ceggers@arri.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.