All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] gpio: dwapb_gpio: fix broken dev->node
Date: Fri, 24 May 2019 00:00:41 +0200	[thread overview]
Message-ID: <4cb5fe07-8d91-bf77-1c66-aa4163dc5222@denx.de> (raw)
In-Reply-To: <20190523184355.21045-1-simon.k.r.goldschmidt@gmail.com>

On 5/23/19 8:43 PM, Simon Goldschmidt wrote:
> commit 1b898ff ("gpio: dwapb_gpio: convert to livetree") introduced
> a bug in that dev->node of the gpio chip was accidentally set to the
> of_node of its bank subnode.
> 
> What it meant to do was assign subdev->node, not dev->node.
> 
> While this doesn't affect too many use cases, iterating over the gpio
> chip's properties doesn't work any more after that, so fix this
> properly by calling 'device_bind_ofnode()' to bind the sub-device
> instead of calling 'device_bind()' and then assigning subdev->node
> manually.
> 
> Fixes: commit 1b898ff ("gpio: dwapb_gpio: convert to livetree")
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> ---
> 
> This applies on top of 0aec330931c5 in u-boot-socfpga/master which it
> should be squashed into.
> ---
>  drivers/gpio/dwapb_gpio.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c
> index d6887a396a..2eb1547b4f 100644
> --- a/drivers/gpio/dwapb_gpio.c
> +++ b/drivers/gpio/dwapb_gpio.c
> @@ -185,12 +185,11 @@ static int gpio_dwapb_bind(struct udevice *dev)
>  			plat->name = ofnode_get_name(node);
>  		}
>  
> -		ret = device_bind(dev, dev->driver, plat->name,
> -				  plat, -1, &subdev);
> +		ret = device_bind_ofnode(dev, dev->driver, plat->name,
> +					 plat, node, &subdev);
>  		if (ret)
>  			return ret;
>  
> -		subdev->node = node;
>  		bank++;
>  	}
>  
> 
Applied, thanks

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2019-05-23 22:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 18:43 [U-Boot] [PATCH] gpio: dwapb_gpio: fix broken dev->node Simon Goldschmidt
2019-05-23 22:00 ` Marek Vasut [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-21 20:03 Simon Goldschmidt
2019-05-21 20:09 ` Marek Vasut
2019-05-22  8:46   ` Simon Goldschmidt
2019-05-22 11:42     ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4cb5fe07-8d91-bf77-1c66-aa4163dc5222@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.