[lkml]   [2016]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] gpio: of: Allow overriding the device node
On Wed, Jul 6, 2016 at 3:05 AM, Masahiro Yamada
<> wrote:

> Question:
> When we reference the node of gpiochip,
> we should use
> chip->gpiodev->dev->of_node
> instead of
> chip->of_node
> because we can make chip->of_node optional
> as long as chip->parent is set in the probe method.
> Correct?

Yes, if you see any bug with respect to this, just fix them.

Overall my appraisal of the situation is that it's a mess.
chip->of_node should not exist, we need to investigate all
cases where this is actually used by drivers and kill them all
off, they should all be using the parent to pass the device
containing the right of node so we can get rid of this:

/* If the gpiochip has an assigned OF node this takes precedence */
if (chip->of_node)
gdev->dev.of_node = chip->of_node;

I don't know why this extra OF node is there in the first
place and in which circumstances it may be used, maybe
Grant knows.

I understand so much as that it would be a situation where
you have a GPIO device node but it does not have a corresponding
device of any type, but I fail to see what circumstance would
make that happen.

Linus Walleij

 \ /
  Last update: 2016-07-06 12:01    [W:0.045 / U:2.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site