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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vecxx+YBrZ9d4oZzqS_X3cxUQ4UaSvjqjhuaoJ4O9xauw@mail.gmail.com>
Date:	Thu, 25 Feb 2016 15:43:03 +0200
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	qiujiang <qiujiang@...wei.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	linuxarm@...wei.com, haifeng.wei@...wei.com,
	charles.chenxin@...wei.com
Subject: Re: [PATCH v3 1/2] gpio: designware: switch device node to fwnode

On Thu, Feb 25, 2016 at 1:58 PM, Jiang Qiu <qiujiang@...wei.com> wrote:
> 在 2016/2/24 21:46, Andy Shevchenko 写道:
>> On Wed, Feb 24, 2016 at 2:33 PM, qiujiang <qiujiang@...wei.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?

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

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ