Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1344934

Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode

From Jiang Qiu <qiujiang@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode
Date 2016-02-27 08:20 +0100
Message-ID <r6Hkt-7WW-1@gated-at.bofh.it> (permalink)
References <r5GJQ-4si-3@gated-at.bofh.it> <r5GJQ-4si-5@gated-at.bofh.it> <r5HZh-5i2-45@gated-at.bofh.it> <r62Km-3eF-3@gated-at.bofh.it> <r64sP-4uZ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


在 2016/2/25 21:43, Andy Shevchenko 写道:
> On Thu, Feb 25, 2016 at 1:58 PM, Jiang Qiu <qiujiang@huawei.com> wrote:
>> 在 2016/2/24 21:46, Andy Shevchenko 写道:
>>> On Wed, Feb 24, 2016 at 2:33 PM, qiujiang <qiujiang@huawei.com> wrote:
> 
>>>  - why do you use fwnode_*() instead of device_property_*() calls?
>>> What prevents us to move to device property API directly?
>> Yes, it looks more reasonable by using devce_property. Howerver,
>> device_get_child_node_count was used here to find each child node. This
>> API output the fwnode_handle for each child node directly, but device
>> property APIs need 'dev' data instead. Actually, the effects of fwnode_*()
>> and device_*() are the same. So, I used fwnode_*() APIs here.
> 
> Right, looks okay then.
> 
>>>> -       node = dev->of_node;
>>>> -       if (!IS_ENABLED(CONFIG_OF_GPIO) || !node)
>>>> +       if (!IS_ENABLED(CONFIG_OF_GPIO) || !(dev->of_node))
>>>>                 return ERR_PTR(-ENODEV);
>>>
>>> So, since you converted to fwnode, do you still need this check?
>>>
>> Although this patch coverted device node to fwnode, only DTs binding was
>> supported here, and patch2 support ACPI will remove this check.
> 
> Yes, but like I said below device_get_child_node_count() will take
> care of that, will it?
Right, device_get_child_node_count() will take of it, this should be removed.
> 
>>>>
>>>> -       nports = of_get_child_count(node);
>>>> +       nports = device_get_child_node_count(dev);
>>>>         if (nports == 0)
>>>>                 return ERR_PTR(-ENODEV);
>>>
>>> ...I think this one fail if it will not found any child.
>> This one fail? yes, it will return to failure.
>> I am not very clear here.
> 
> See above.
Here, device_get_child_node_count will return ZERO if there is not any child.
So, I think this will work ok, will it?
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/2] gpio: designware: add gpio-signaled acpi events support for power button qiujiang <qiujiang@huawei.com> - 2016-02-24 13:30 +0100
  [PATCH v3 1/2] gpio: designware: switch device node to fwnode qiujiang <qiujiang@huawei.com> - 2016-02-24 13:30 +0100
    Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-02-24 14:50 +0100
      Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-02-25 13:00 +0100
        Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-02-25 14:50 +0100
          Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode Jiang Qiu <qiujiang@huawei.com> - 2016-02-27 08:20 +0100
            Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-02-29 11:50 +0100
  [PATCH v3 2/2] gpio: designware: add gpio-signaled acpi events support for power button qiujiang <qiujiang@huawei.com> - 2016-02-24 13:30 +0100
    Re: [PATCH v3 2/2] gpio: designware: add gpio-signaled acpi events  support for power button Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-02-24 14:50 +0100
      Re: [PATCH v3 2/2] gpio: designware: add gpio-signaled acpi events  support for power button Jiang Qiu <qiujiang@huawei.com> - 2016-02-25 13:20 +0100

csiph-web