[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdb5R+VQrv0QuKa+EYmAMkodRpyv4fV1QCWQ+vcEyd0sZQ@mail.gmail.com>
Date: Mon, 1 Mar 2021 15:51:19 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: "Enrico Weigelt, metux IT consult" <info@...ux.net>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>
Subject: Re: [RFC PATCH 07/12] gpio: amd-fch: add oftree probing support
On Mon, Feb 8, 2021 at 11:24 PM Enrico Weigelt, metux IT consult
<info@...ux.net> wrote:
> Add support for probing via device tree.
(...)
> + pdata->gpio_num = of_property_count_elems_of_size(dev->of_node,
> + "gpio-regs",
> + sizeof(u32));
> + pdata->gpio_reg = devm_kzalloc(dev, sizeof(int)*pdata->gpio_num,
> + GFP_KERNEL);
> + if (!pdata->gpio_reg)
> + goto nomem;
I don't know what the idea is with this but register are not normally defined
in the DTS files. The registers are determined from the compatible value.
> + pdata->gpio_names = devm_kzalloc(dev, sizeof(char*)*pdata->gpio_num,
> + GFP_KERNEL);
> + if (!pdata->gpio_names)
> + goto nomem;
(...)
> + ret = of_property_read_string_array(dev->of_node, "gpio-line-names",
> + pdata->gpio_names, pdata->gpio_num);
And this is already handled by the core.
Yours,
Linus Walleij
Powered by blists - more mailing lists