From patchwork Wed Aug 15 18:05:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ley Foon Tan X-Patchwork-Id: 957838 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=intel.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41r4rL1pGYz9sBZ for ; Wed, 15 Aug 2018 20:06:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E6AE8C21E07; Wed, 15 Aug 2018 10:06:23 +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=none 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 1EB26C21E13; Wed, 15 Aug 2018 10:06:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 298A9C21DA6; Wed, 15 Aug 2018 10:06:08 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lists.denx.de (Postfix) with ESMTPS id BDA68C21DC1 for ; Wed, 15 Aug 2018 10:06:04 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2018 03:06:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,242,1531810800"; d="scan'208";a="80439551" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.248.105]) by fmsmga004.fm.intel.com with SMTP; 15 Aug 2018 03:06:00 -0700 Received: by ubuntu (sSMTP sendmail emulation); Thu, 16 Aug 2018 02:05:59 +0800 From: Ley Foon Tan To: u-boot@lists.denx.de Date: Thu, 16 Aug 2018 02:05:54 +0800 Message-Id: <1534356355-3121-2-git-send-email-ley.foon.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534356355-3121-1-git-send-email-ley.foon.tan@intel.com> References: <1534356355-3121-1-git-send-email-ley.foon.tan@intel.com> Cc: Marek Vasut , Tom Rini , Chin Liang See Subject: [U-Boot] [PATCH] gpio: dwapb_gpio: Change to use dev_read_addr() 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This changes the driver to use dev_read_addr() which is safe both for flat trees and live trees. Signed-off-by: Ley Foon Tan Acked-by: Marek Vasut --- drivers/gpio/dwapb_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index a118f58..680b11a 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -111,7 +111,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (plat) return 0; - base = fdtdec_get_addr(blob, dev_of_offset(dev), "reg"); + base = dev_read_addr(dev); if (base == FDT_ADDR_T_NONE) { debug("Can't get the GPIO register base address\n"); return -ENXIO;