From patchwork Thu May 23 18:43:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1104350 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="o++i1oo3"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 458z1b1cDwz9s4V for ; Fri, 24 May 2019 04:44:19 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9DE96C21EA6; Thu, 23 May 2019 18:44:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BDBC1C21DB6; Thu, 23 May 2019 18:44:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 223ADC21DB6; Thu, 23 May 2019 18:44:08 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by lists.denx.de (Postfix) with ESMTPS id BE46BC21DAF for ; Thu, 23 May 2019 18:44:07 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id d18so7384846wrs.5 for ; Thu, 23 May 2019 11:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Lx/49/kV7yd78Sr6RwT5OkAr8QUwTVw6FqiFuV14JjA=; b=o++i1oo3B8ND3EAgLHTWnGpvGb70PkP41B+3J05LRUT0UPKJ2H3CGYIRF0bxZE/u8E i9VJUxueDS2Jmr1SlZpDvikqfXmq1qLUmSpDtk6hHVlwY9iXwDGM7RjBGOvKJD638Fs5 P5bUvKYWvajYsyDxPoOze59pwrH0gXZ7Rde19rvYoeiUIMlemUK/Qwa5w592iSOAdNEN uuTN/Mz/Z5NR5fprDXEvvGPIhncRo85fMraTS8Dlr44ADO2V7nRD85bgWTM5vR/C07Bn GH4qAxnikHlA5GcOz/DDUj+CyOBFqmae+75w60O1Cb4+ETVcyVO6pjrqKEvAnHlLs89L buMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Lx/49/kV7yd78Sr6RwT5OkAr8QUwTVw6FqiFuV14JjA=; b=FD5HTp4s4mzKNEYIMbYgpChQvlb8eLL8/lgiAhW8opK25Z656rZy4qegew7rXtMy2v EP9jKaqz6AEsWRSgncWWpto5ETaq4we/yrwOVc489fkjB+gGBM7gbHlvWLyxT00w9/Oc KWLHnoWvFSoaZVGmN3Cm/qxBH2xhRu9zBldzfV0zhb6c47BP2/T2F7FYtm93azwPeHx6 Uu/q8sx9EGn9CExILKZTEuUt5rfopEsQKqztgPw9tlLmRnz7g3O3FBUFapfYq5xWvqC4 huXVB24cH69xtH7KefQ1PenIjeAGykDaoPTAhliX60YnFTb+Dz4ZAs0BrK2L+OfjC5Qr ++Bg== X-Gm-Message-State: APjAAAU67vwFWjNwfHbkCNBwDhVOvHT4Nh1/oMiIj2gmDIlFLZOw/fOR yM1LKD9W3xFl34/iVJ74+nI= X-Google-Smtp-Source: APXvYqy+eUHvOSLRaxEWk+eUrDV3FKOhcccmiBLbj3V3qfuooZOb5jZgwb41KTqMu4kAOVBBrAOfTg== X-Received: by 2002:adf:efc3:: with SMTP id i3mr44799538wrp.45.1558637047388; Thu, 23 May 2019 11:44:07 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id x1sm88508wrp.35.2019.05.23.11.44.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 11:44:06 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 23 May 2019 20:43:55 +0200 Message-Id: <20190523184355.21045-1-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: u-boot@lists.denx.de, Chin Liang See Subject: [U-Boot] [PATCH] gpio: dwapb_gpio: fix broken dev->node X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- 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++; }