Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1355519
| From | Jiang Qiu <qiujiang@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode |
| Date | 2016-03-11 02:00 +0100 |
| Message-ID | <rbjAS-6wH-3@gated-at.bofh.it> (permalink) |
| References | <r8Sv7-3eE-3@gated-at.bofh.it> <r8Sv7-3eE-1@gated-at.bofh.it> <rbehQ-2Wa-15@gated-at.bofh.it> <rbfnA-3B5-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
在 2016/3/11 4:27, Andy Shevchenko 写道:
> On Thu, Mar 10, 2016 at 9:09 PM, Alan Tull <delicious.quinoa@gmail.com> wrote:
>> On Fri, Mar 4, 2016 at 1:44 AM, qiujiang <qiujiang@huawei.com> wrote:
>>> This patch converts device node to fwnode in
>>> dwapb_port_property for designware gpio driver,
>>> so as to provide a unified data structure for DT
>>> and ACPI bindings.
>>>
>>> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>>> Signed-off-by: qiujiang <qiujiang@huawei.com>
>>> @@ -496,18 +492,19 @@ dwapb_gpio_get_pdata_of(struct device *dev)
>>> * Only port A can provide interrupts in all configurations of
>>> * the IP.
>>> */
>>> - if (pp->idx == 0 &&
>>> - of_property_read_bool(port_np, "interrupt-controller")) {
>>> - pp->irq = irq_of_parse_and_map(port_np, 0);
>>> + if (dev->of_node && pp->idx == 0 &&
>>> + of_property_read_bool(to_of_node(fwnode),
>>> + "interrupt-controller")) {
>> Hi Qiujiang,
>>
>> Is there a reason to use "of_property_read_bool" here instead of
>> "device_property_read_bool" or similar?
> Yeah, this patch looks unfinished.
>
> This should be
> if (pp->idx == 0 && fwnode_property_read_bool(fwnode,
> "interrupt-controller")) {
Yes, agreed, "to_of_node" will never appear in this patch : )
>> Alan
>>
>>> + pp->irq = irq_of_parse_and_map(to_of_node(fwnode), 0);
> But here should be common method called which takes fwnode on input.
Agreed.
>
>>> if (!pp->irq) {
>>> dev_warn(dev, "no irq for bank %s\n",
>>> - port_np->full_name);
>>> + to_of_node(fwnode)->full_name);
>>> }
>>> }
>>>
>>> pp->irq_shared = false;
>>> pp->gpio_base = -1;
>>> - pp->name = port_np->full_name;
>>> + pp->name = to_of_node(fwnode)->full_name;
> Also those two should be device property source agnostic. That's what
> I tried to tell earlier.
Agreed.
Thanks, Jiang
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Alan Tull <delicious.quinoa@gmail.com> - 2016-03-10 20:20 +0100
Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-03-10 21:30 +0100
Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-03-11 02:00 +0100
Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-03-15 14:00 +0100
Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-03-11 01:50 +0100
csiph-web