lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKnuycUSHfxxcZMcidELA-ttZUv5NhV5ApkpUQMsc-aQQ@mail.gmail.com>
Date:   Fri, 18 Nov 2022 15:52:09 -0600
From:   Rob Herring <robh+dt@...nel.org>
To:     Michael Walle <michael@...le.cc>
Cc:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Frank Rowand <frowand.list@...il.com>,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        devicetree@...r.kernel.org
Subject: Re: [PATCH] of: property: special #nvmem-cell-cells handling

On Fri, Nov 18, 2022 at 3:40 PM Michael Walle <michael@...le.cc> wrote:
>
> Since recently, there is a new #nvmem-cell-cells. To be backwards
> compatible this is optional. Therefore, we need special handling and
> cannot use DEFINE_SIMPLE_PROP() anymore.
>
> Signed-off-by: Michael Walle <michael@...le.cc>
> ---
> This patch will be part of the following series:
> https://lore.kernel.org/linux-arm-kernel/20221118185118.1190044-1-michael@walle.cc/
>
>  drivers/of/property.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 967f79b59016..93c0ea662336 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -1305,7 +1305,6 @@ DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells")
>  DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
>  DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "#hwlock-cells")
>  DEFINE_SIMPLE_PROP(extcon, "extcon", NULL)
> -DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", NULL)
>  DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
>  DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
>  DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)
> @@ -1381,6 +1380,22 @@ static struct device_node *parse_interrupts(struct device_node *np,
>         return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np;
>  }
>
> +static struct device_node *parse_nvmem_cells(struct device_node *np,
> +                                            const char *prop_name, int index)
> +{
> +       struct of_phandle_args sup_args;
> +
> +       if (strcmp(prop_name, "nvmem-cells"))
> +               return NULL;
> +
> +       if (of_parse_phandle_with_optional_args(np, prop_name,
> +                                               "#nvmem-cell-cells", index,
> +                                               &sup_args))
> +               return NULL;
> +
> +       return sup_args.np;
> +}

There's a couple of other cases like that (MSI IIRC), so can we
generalize this to work in more than 1 case?

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ