From patchwork Tue Aug 4 05:14:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 247424 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp47629ilo; Mon, 3 Aug 2020 22:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkOBkQnKJN6j2Gn2zrUgVHYGcRhcNl9rCDLAZuiVHNoNbJ91z2GxUrG2XmA3A+ZYLPthHY X-Received: by 2002:a17:906:68da:: with SMTP id y26mr19320613ejr.250.1596518143032; Mon, 03 Aug 2020 22:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596518143; cv=none; d=google.com; s=arc-20160816; b=jT3Uku1pm7b8mCQ4yinjTOkDM5hyh+GibY56BRU5Wgb58sPFsPYCVa2H2rDBED3gOD YwZ8/Bl5sb8cprZgL8rZQvg2aITMeiuj1yuIqpMZftRUZsatrvegvkaRo1ORc4wN2ciB tv+P690j6daflcoWHWYGZrra/p1X+LzTy6iLdBH9D8bx8Xy9ElxMara6zrhMp4EnhY7m 0brR0esxQLMrSt8krQoQTDaSw6vDcHu/Kh6HKK2m+Hy5khkuXHbntW1Ywip2dbet6UFq z+DLFkUCi/1ZPMcPzF6UdAHOujqDkcewUfFGJ67lvQ/X9MlZXAJF4GC0tkhWX8NS25hZ 1Slg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=XKj3Z0oPtP0ozPsw/T5aQD+JQFSoBuxuSQrDV42dlOI=; b=klSuo3+g26TsVWh4NAf/NQvjo8BCO3omBLc1dAFAr9ja1H5P0MSK4c9nqxR7hUO2oy m3FVbBNX+asBltxHAllE05tbrtL0FmwP9R+Su0y05vyk29AvWZwqg1pwCa+RB4BE6Vzm CcDLx6ET9o037HOx+7/0JKTshSMjMesOAq23ypHim8xmGfljuVeQtF+DwC9jtI+8wGF6 TtNIXnZqqkViHdxQKk7WJG3NOvEaqynghUpioRyHsrHba8McvjFGFqz8xs0ef8m3Mkem CaLDABMOQwtJE47WZCrYt05mectAxOz8j7Y4YvNJtR9BSmdpuMh98289KKhL3AWGeNEY XXvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ER+LiwDj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 15si11238465ejw.370.2020.08.03.22.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 22:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ER+LiwDj; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 023D481F2D; Tue, 4 Aug 2020 07:15:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="ER+LiwDj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3463E81F2D; Tue, 4 Aug 2020 07:15:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 462A681F2D for ; Tue, 4 Aug 2020 07:15:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=yamada.masahiro@socionext.com Received: from oscar.flets-west.jp (softbank126025067101.bbtec.net [126.25.67.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 0745EjuR000567; Tue, 4 Aug 2020 14:14:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 0745EjuR000567 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1596518086; bh=XKj3Z0oPtP0ozPsw/T5aQD+JQFSoBuxuSQrDV42dlOI=; h=From:To:Cc:Subject:Date:From; b=ER+LiwDjlhAMJ0828wGSo8xbHlXesRqtmwwpgFvb2MH7R0aP/lIZDSLRyjNjwxzJy dM5PAVq3o6uZLFSz43jOgS4vjGXhBrHnoqs5d6/OB1rBjplIzB3YPC7k328ZcQ2ThF v8NPYGMsBAwTGE7oTOTsdkf8jfaIEx+PSh8jdJoqBkGpeECl0WfNw6/+WDw/0qQ6/P CgeAfZg5cLyXru95G6KElYiu9dbsv+L7u4pTvle+mSMlXaB90hHXkLPZwvJaXZWSc6 fGpK1w8fTQxD539d/IwG/16/7UIcCmU82/+bVGJ9/tnD5pDembKSX3bq4xTpNl1ppU p8hm8+O3geHlA== X-Nifty-SrcIP: [126.25.67.101] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Masahiro Yamada , =?utf-8?q?Andreas_Bie?= =?utf-8?b?w59tYW5u?= , Eugen Hristev , James Byrne , Simon Glass , Walter Lozano Subject: [PATCH 1/3] gpio: at91: use dev_read_addr() to get base address Date: Tue, 4 Aug 2020 14:14:41 +0900 Message-Id: <20200804051443.1074096-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean It is strange to use devfdt_get_addr_ptr(), then cast the pointer back to uint32 because you could use devfdt_get_addr() without casting. Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE. Signed-off-by: Masahiro Yamada --- drivers/gpio/at91_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Simon Glass diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c index 4a8b2e6ff6..ef7984374b 100644 --- a/drivers/gpio/at91_gpio.c +++ b/drivers/gpio/at91_gpio.c @@ -606,7 +606,7 @@ static int at91_gpio_probe(struct udevice *dev) clk_free(&clk); #if CONFIG_IS_ENABLED(OF_CONTROL) - plat->base_addr = (uint32_t)devfdt_get_addr_ptr(dev); + plat->base_addr = dev_read_addr(dev); #endif plat->bank_name = at91_get_bank_name(plat->base_addr); port->regs = (struct at91_port *)plat->base_addr; From patchwork Tue Aug 4 05:14:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 247423 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp47498ilo; Mon, 3 Aug 2020 22:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDvCIh0nDdXWtsGJrtCrVcBuVhBmgO0tcC+EfuK2goKOPvwPJaSsldQuI1WyEFAs/2CqcI X-Received: by 2002:a17:906:868d:: with SMTP id g13mr19500959ejx.242.1596518130466; Mon, 03 Aug 2020 22:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596518130; cv=none; d=google.com; s=arc-20160816; b=dmGLmGFZxP2y7dYLCqkO0bd7VGGFuPdiqFBznmJzoehBS3u3Ad8YIIjOrpydZOXUbE kyjc0Ne+tXcupZvMYxJZpvsEGoS3rfZOmr6hTTCsTpEFnOCTJELnyFNXTYsPJWY2EJpu XG2LeYU5L8lP47NzXmx6pzzAu7dNSlXDnSz64yCOZ0irASsJI5DDbmi1cnHfdSaZpdoV 6Xsa0KZV6An/wuNwOA18YKdI5SxuT6ywg1D3mqehOMW8tmQ0HXha7WXMcdjDuL3nmiaK vd3INg4JsjzJTpBvGGVEA3KrjdgcP9fyX6d+5nqyV4rkjK23IduO2A2ZUz9aR0y8fLk1 dREw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=oAho0pSyI34DKNa8UVqYeD2qH/s3fVgi1Ql4dxJfBKc=; b=wEv3l16iPQPdgCqJe7IqjYQTHBjE1iQ8HWGnerzfI1wqHh6DATk08SH314A0b93qxi MYHwcqbhOIKSK/gl3zdTge0hXcJFEi5KPBOXt9XIUo880KhrvQxfhEp81iiL2DYm43fV tWUcypNBUie+0Wsz2BXHs1QVwuZZjd5EGUzsLFUMuEgy8hp3QxaQf6YVExoTH0doiySL 6jgi3cLT3vBiKuyD6R/jfokrq6Aqv10xxHyb2OYH0SZEj2j1iRHNqUzzAPgwWvJBmBn2 taVvWrN/PNmmZ9DS7hmxUynGjs3CB/ssio7HxuiG9rJxX3UjJVg9adarMywS0oxi/RgV hYGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gdX2z9U3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id bs17si10588369edb.367.2020.08.03.22.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 22:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gdX2z9U3; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A70E181D71; Tue, 4 Aug 2020 07:15:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="gdX2z9U3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A98281E39; Tue, 4 Aug 2020 07:15:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DB64281260 for ; Tue, 4 Aug 2020 07:15:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=yamada.masahiro@socionext.com Received: from oscar.flets-west.jp (softbank126025067101.bbtec.net [126.25.67.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 0745EjuS000567; Tue, 4 Aug 2020 14:14:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 0745EjuS000567 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1596518086; bh=oAho0pSyI34DKNa8UVqYeD2qH/s3fVgi1Ql4dxJfBKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gdX2z9U3Vq9BXsMUm3GbqyyCCbc0jf19EXqsmpzqAMM8xvTmdjpS2OnC7Bksax3lf sHHERJPUNcne5P6XCgZikDIjFsSDhWm8X2guFkqSXABtVIOcT9k7S5vVe5jeBRMKFU LOzgIwOpVWRqyidw11q6R5mznfkD2KNVJ6jPz1LZpowoNXC/CaQQ/SCm8xGPwIOJ2l AUPc/1d0BEa27/JozPdxJN8s+cGPN32V9/YzKp+4ZOzFn9NNdxCzSF3mOP2zbZQqbS uhaffJPQ50UaEpsP4FGTgmaxF3uESA0vkf4ieAFRl8cC71BeSbepUGs5MNlKdrhsbk w2zwqZh5V00Mg== X-Nifty-SrcIP: [126.25.67.101] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Masahiro Yamada , Stefan Roese Subject: [PATCH 2/3] ata: mvebu: use dev_read_addr() to get base address Date: Tue, 4 Aug 2020 14:14:42 +0900 Message-Id: <20200804051443.1074096-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200804051443.1074096-1-yamada.masahiro@socionext.com> References: <20200804051443.1074096-1-yamada.masahiro@socionext.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean It is strange to use devfdt_get_addr_ptr(), then cast the pointer back to ulong because you could use devfdt_get_addr() without casting. Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE. Signed-off-by: Masahiro Yamada --- drivers/ata/ahci_mvebu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Stefan Roese diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index 8be1826d40..7d82d2ea3f 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -39,7 +39,7 @@ static int mvebu_ahci_probe(struct udevice *dev) */ board_ahci_enable(); - ahci_probe_scsi(dev, (ulong)devfdt_get_addr_ptr(dev)); + ahci_probe_scsi(dev, dev_read_addr(dev)); return 0; } From patchwork Tue Aug 4 05:14:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 247425 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp47818ilo; Mon, 3 Aug 2020 22:16:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhlGcZ5zU7wSOpBfsZXWmbCc3FELhQ32FEj6Xn461mFTgnVgKxPJ3cxNJtq2xMV55WRZJB X-Received: by 2002:a17:906:af72:: with SMTP id os18mr19434872ejb.43.1596518164121; Mon, 03 Aug 2020 22:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596518164; cv=none; d=google.com; s=arc-20160816; b=bYdIN9ZewY9doz18TSfe5MWvRb88s+MjSSQNvSQZROlBVX9WCWUho/WAcTwU7kv1D4 S1FmuGuX6vW0UnipARfSNII+OKqH8P+YFhQwsmpZszp62V7XpPeAxc+D+Nv2ZJuPdL+U vLzb3I55OgBtlpsnqL4e/j31xf5FP0ufr+2prqSedDPdx+ElD+mUeB3nDb5drOXlCXiZ pT0tilQC6dv+JuSjFA/TB5FZaTn72+8ZGBlqzTBaOIxUYcal1lJv4nGbjoMOn6SJeHbE +cnB99cinKB+Kmq6PuaI3uCbEbQLy/9sD7xnMYj6atQa1ttFKrO+ogsnItYZHeMhVM1S eJcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=tWrGj+tfUTn+N1G47+6F3U90p/jIBStXeOJ4pHo3foo=; b=Vs98hv04wT2k/cNGLfBiWl5frtdvkII5QdonlPfLrGbYVLQjyryXra0LO2BJmdy/aP DkU6LB93zGZ5HB2ISKZV1UpcPgWinNLq6XU6IAjryVksU2IME4PlOZhG5U19CY/SsFX5 HnZzQhptoAXvHAcfQ2UI/PJmRCyugO5FDOq50ONXw+CacOKNPmhDhTNAZBztrF2viQX8 dv4PNs7oGJw6WagCrUD2083g0tCx2VFFLhrOcyCj3ZeKYx3d6wbLHBIBHMV8uSYTvk0E GLE//V/TzNs+alZeZ/hNGUcLOqK9pHaxXSU5YO3ipTNVaxBaZD9ofpEqrjOrlLGwwYpX 03nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=jOephQk1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id q2si11566617edj.526.2020.08.03.22.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 22:16:04 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=jOephQk1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E607481E39; Tue, 4 Aug 2020 07:16:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="jOephQk1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EBD0181F2D; Tue, 4 Aug 2020 07:16:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7420081E39 for ; Tue, 4 Aug 2020 07:15:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=yamada.masahiro@socionext.com Received: from oscar.flets-west.jp (softbank126025067101.bbtec.net [126.25.67.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 0745EjuT000567; Tue, 4 Aug 2020 14:14:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 0745EjuT000567 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1596518088; bh=tWrGj+tfUTn+N1G47+6F3U90p/jIBStXeOJ4pHo3foo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jOephQk1dv0gblX7y0/sV35elqDh+WhQHSmsI66O4uW32nLfmnKkDsXG7DTEPyLJM 4Ds4rzgMc1YNMrMoNbTljl00Es3vh/h1U5GsPpScwHln7/n7b+oQ1PuUnwhm+TUq39 VDWI2STspj92QaVDuxI5913rSTa3o/D/2JCGLJ3Epe4hfTbIPl5N2Mu5DuWTIaCZV5 boSc4CIIVRrFjlu48nGYbK5RszIxENg9wyzYgDm7Say97+nJUyLH0pKPyZBfY7XRX6 43IPwb621uu3M85OYFGnLjTIRZStb+UU104m+gtOgIDTq+AGxyiwE+U5oOGCuQ2c5g hCx4e4FWHIaGA== X-Nifty-SrcIP: [126.25.67.101] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Masahiro Yamada , Anatolij Gustschin , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Eddie James , Eugeniy Paltsev , Heiko Schocher , Jagan Teki , Joe Hershberger , Ley Foon Tan , Lukasz Majewski , Marek Vasut , Michal Simek , Patrick Delaunay , Peng Fan , Simon Glass , Simon Goldschmidt , Walter Lozano , uboot-snps-arc@synopsys.com Subject: [PATCH 3/3] treewide: convert devfdt_get_addr_ptr() to dev_read_addr_ptr() Date: Tue, 4 Aug 2020 14:14:43 +0900 Message-Id: <20200804051443.1074096-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200804051443.1074096-1-yamada.masahiro@socionext.com> References: <20200804051443.1074096-1-yamada.masahiro@socionext.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean When you enable CONFIG_OF_LIVE, you will end up with a lot of conversions. To help this tedious work, this commit converts devfdt_get_addr_ptr() to dev_read_addr_ptr() by coccinelle. I also removed redundant casts because dev_read_addr_ptr() returns an opaque pointer. To generate this commit, I ran the following semantic patch excluding include/dm/. @@ type T; expression dev; @@ -(T *)devfdt_get_addr_ptr(dev) +dev_read_addr_ptr(dev) @@ expression dev; @@ -devfdt_get_addr_ptr(dev) +dev_read_addr_ptr(dev) Signed-off-by: Masahiro Yamada --- drivers/clk/aspeed/clk_ast2500.c | 2 +- drivers/clk/at91/pmc.c | 4 ++-- drivers/gpio/hsdk-creg-gpio.c | 2 +- drivers/i2c/ast_i2c.c | 2 +- drivers/i2c/designware_i2c.c | 2 +- drivers/i2c/mv_i2c.c | 2 +- drivers/i2c/mvtwsi.c | 4 ++-- drivers/mmc/gen_atmel_mci.c | 2 +- drivers/mmc/snps_dw_mmc.c | 2 +- drivers/pinctrl/mvebu/pinctrl-mvebu.c | 2 +- drivers/reset/reset-socfpga.c | 2 +- drivers/serial/serial_mvebu_a3700.c | 2 +- drivers/spi/uniphier_spi.c | 2 +- drivers/sysreset/sysreset_socfpga.c | 2 +- drivers/timer/ast_timer.c | 2 +- drivers/timer/atmel_pit_timer.c | 2 +- drivers/usb/host/ehci-zynq.c | 2 +- drivers/watchdog/ast_wdt.c | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) -- 2.25.1 Reviewed-by: Simon Glass Reviewed-by: Simon Glass diff --git a/drivers/clk/aspeed/clk_ast2500.c b/drivers/clk/aspeed/clk_ast2500.c index ccfeded30c..1414d26a53 100644 --- a/drivers/clk/aspeed/clk_ast2500.c +++ b/drivers/clk/aspeed/clk_ast2500.c @@ -497,7 +497,7 @@ static int ast2500_clk_ofdata_to_platdata(struct udevice *dev) { struct ast2500_clk_priv *priv = dev_get_priv(dev); - priv->scu = devfdt_get_addr_ptr(dev); + priv->scu = dev_read_addr_ptr(dev); if (IS_ERR(priv->scu)) return PTR_ERR(priv->scu); diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index 54ae0d281d..ca90abef2d 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c @@ -41,7 +41,7 @@ int at91_pmc_core_probe(struct udevice *dev) dev = dev_get_parent(dev); - plat->reg_base = (struct at91_pmc *)devfdt_get_addr_ptr(dev); + plat->reg_base = dev_read_addr_ptr(dev); return 0; } @@ -116,7 +116,7 @@ int at91_clk_probe(struct udevice *dev) dev_periph_container = dev_get_parent(dev); dev_pmc = dev_get_parent(dev_periph_container); - plat->reg_base = (struct at91_pmc *)devfdt_get_addr_ptr(dev_pmc); + plat->reg_base = dev_read_addr_ptr(dev_pmc); return 0; } diff --git a/drivers/gpio/hsdk-creg-gpio.c b/drivers/gpio/hsdk-creg-gpio.c index d9df804f63..35b114904d 100644 --- a/drivers/gpio/hsdk-creg-gpio.c +++ b/drivers/gpio/hsdk-creg-gpio.c @@ -83,7 +83,7 @@ static int hsdk_creg_gpio_probe(struct udevice *dev) u32 shift, bit_per_gpio, activate, deactivate, gpio_count; const u8 *defaults; - hcg->regs = (u32 *)devfdt_get_addr_ptr(dev); + hcg->regs = dev_read_addr_ptr(dev); gpio_count = dev_read_u32_default(dev, "gpio-count", 1); shift = dev_read_u32_default(dev, "gpio-first-shift", 0); bit_per_gpio = dev_read_u32_default(dev, "gpio-bit-per-line", 1); diff --git a/drivers/i2c/ast_i2c.c b/drivers/i2c/ast_i2c.c index 214362d04b..d122157591 100644 --- a/drivers/i2c/ast_i2c.c +++ b/drivers/i2c/ast_i2c.c @@ -92,7 +92,7 @@ static int ast_i2c_ofdata_to_platdata(struct udevice *dev) struct ast_i2c_priv *priv = dev_get_priv(dev); int ret; - priv->regs = devfdt_get_addr_ptr(dev); + priv->regs = dev_read_addr_ptr(dev); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs); diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c index cf892c69d9..569a5d39b4 100644 --- a/drivers/i2c/designware_i2c.c +++ b/drivers/i2c/designware_i2c.c @@ -768,7 +768,7 @@ int designware_i2c_ofdata_to_platdata(struct udevice *bus) int ret; if (!priv->regs) - priv->regs = (struct i2c_regs *)devfdt_get_addr_ptr(bus); + priv->regs = dev_read_addr_ptr(bus); dev_read_u32(bus, "i2c-scl-rising-time-ns", &priv->scl_rise_time_ns); dev_read_u32(bus, "i2c-scl-falling-time-ns", &priv->scl_fall_time_ns); dev_read_u32(bus, "i2c-sda-hold-time-ns", &priv->sda_hold_time_ns); diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c index 59675d8d57..82e8fdac41 100644 --- a/drivers/i2c/mv_i2c.c +++ b/drivers/i2c/mv_i2c.c @@ -580,7 +580,7 @@ static int mv_i2c_probe(struct udevice *bus) { struct mv_i2c_priv *priv = dev_get_priv(bus); - priv->base = (void *)devfdt_get_addr_ptr(bus); + priv->base = dev_read_addr_ptr(bus); return 0; } diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c index d3cc9b9d83..fdb8fd42e5 100644 --- a/drivers/i2c/mvtwsi.c +++ b/drivers/i2c/mvtwsi.c @@ -798,7 +798,7 @@ static int mvtwsi_i2c_ofdata_to_platdata(struct udevice *bus) { struct mvtwsi_i2c_dev *dev = dev_get_priv(bus); - dev->base = devfdt_get_addr_ptr(bus); + dev->base = dev_read_addr_ptr(bus); if (!dev->base) return -ENOMEM; @@ -820,7 +820,7 @@ static void twsi_disable_i2c_slave(struct mvtwsi_registers *twsi) static int mvtwsi_i2c_bind(struct udevice *bus) { - struct mvtwsi_registers *twsi = devfdt_get_addr_ptr(bus); + struct mvtwsi_registers *twsi = dev_read_addr_ptr(bus); /* Disable the hidden slave in i2c0 of these platforms */ if ((IS_ENABLED(CONFIG_ARMADA_38X) || IS_ENABLED(CONFIG_ARCH_KIRKWOOD)) diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c index 9d20e28383..0a347b2fb2 100644 --- a/drivers/mmc/gen_atmel_mci.c +++ b/drivers/mmc/gen_atmel_mci.c @@ -592,7 +592,7 @@ static int atmel_mci_probe(struct udevice *dev) if (ret) return ret; - plat->mci = (struct atmel_mci *)devfdt_get_addr_ptr(dev); + plat->mci = dev_read_addr_ptr(dev); atmel_mci_setup_cfg(dev); diff --git a/drivers/mmc/snps_dw_mmc.c b/drivers/mmc/snps_dw_mmc.c index c606ef011b..4b468a1f3d 100644 --- a/drivers/mmc/snps_dw_mmc.c +++ b/drivers/mmc/snps_dw_mmc.c @@ -83,7 +83,7 @@ static int snps_dwmmc_ofdata_to_platdata(struct udevice *dev) u32 fifo_depth; int ret; - host->ioaddr = devfdt_get_addr_ptr(dev); + host->ioaddr = dev_read_addr_ptr(dev); /* * If fifo-depth is unset don't set fifoth_val - we will try to diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c index 2206e958ec..37707a6319 100644 --- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c +++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c @@ -193,7 +193,7 @@ int mvebu_pinctl_probe(struct udevice *dev) return -EINVAL; } - priv->base_reg = devfdt_get_addr_ptr(dev); + priv->base_reg = dev_read_addr_ptr(dev); if (priv->base_reg == (void *)FDT_ADDR_T_NONE) { debug("%s: Failed to get base address\n", __func__); return -EINVAL; diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c index 830eda9430..1849db4da9 100644 --- a/drivers/reset/reset-socfpga.c +++ b/drivers/reset/reset-socfpga.c @@ -118,7 +118,7 @@ static int socfpga_reset_probe(struct udevice *dev) u32 modrst_offset; void __iomem *membase; - membase = devfdt_get_addr_ptr(dev); + membase = dev_read_addr_ptr(dev); modrst_offset = dev_read_u32_default(dev, "altr,modrst-offset", 0x10); data->modrst_base = membase + modrst_offset; diff --git a/drivers/serial/serial_mvebu_a3700.c b/drivers/serial/serial_mvebu_a3700.c index 7e4cd6c4b4..fb43f88eaf 100644 --- a/drivers/serial/serial_mvebu_a3700.c +++ b/drivers/serial/serial_mvebu_a3700.c @@ -104,7 +104,7 @@ static int mvebu_serial_ofdata_to_platdata(struct udevice *dev) { struct mvebu_platdata *plat = dev_get_platdata(dev); - plat->base = devfdt_get_addr_ptr(dev); + plat->base = dev_read_addr_ptr(dev); return 0; } diff --git a/drivers/spi/uniphier_spi.c b/drivers/spi/uniphier_spi.c index 114bd8abd7..b6456685f8 100644 --- a/drivers/spi/uniphier_spi.c +++ b/drivers/spi/uniphier_spi.c @@ -368,7 +368,7 @@ static int uniphier_spi_ofdata_to_platdata(struct udevice *bus) const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); - plat->base = devfdt_get_addr_ptr(bus); + plat->base = dev_read_addr_ptr(bus); plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency", 12500000); diff --git a/drivers/sysreset/sysreset_socfpga.c b/drivers/sysreset/sysreset_socfpga.c index 178bcb227f..67cec6563a 100644 --- a/drivers/sysreset/sysreset_socfpga.c +++ b/drivers/sysreset/sysreset_socfpga.c @@ -40,7 +40,7 @@ static int socfpga_sysreset_probe(struct udevice *dev) { struct socfpga_sysreset_data *data = dev_get_priv(dev); - data->rstmgr_base = devfdt_get_addr_ptr(dev); + data->rstmgr_base = dev_read_addr_ptr(dev); return 0; } diff --git a/drivers/timer/ast_timer.c b/drivers/timer/ast_timer.c index 3838601f54..4322f05e9f 100644 --- a/drivers/timer/ast_timer.c +++ b/drivers/timer/ast_timer.c @@ -64,7 +64,7 @@ static int ast_timer_ofdata_to_platdata(struct udevice *dev) { struct ast_timer_priv *priv = dev_get_priv(dev); - priv->regs = devfdt_get_addr_ptr(dev); + priv->regs = dev_read_addr_ptr(dev); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs); diff --git a/drivers/timer/atmel_pit_timer.c b/drivers/timer/atmel_pit_timer.c index 70511697fe..843d670b5e 100644 --- a/drivers/timer/atmel_pit_timer.c +++ b/drivers/timer/atmel_pit_timer.c @@ -64,7 +64,7 @@ static int atmel_pit_ofdata_to_platdata(struct udevice *dev) { struct atmel_pit_platdata *plat = dev_get_platdata(dev); - plat->regs = (struct atmel_pit_regs *)devfdt_get_addr_ptr(dev); + plat->regs = dev_read_addr_ptr(dev); return 0; } diff --git a/drivers/usb/host/ehci-zynq.c b/drivers/usb/host/ehci-zynq.c index 939c30999e..80f1d6fd97 100644 --- a/drivers/usb/host/ehci-zynq.c +++ b/drivers/usb/host/ehci-zynq.c @@ -25,7 +25,7 @@ static int ehci_zynq_ofdata_to_platdata(struct udevice *dev) { struct zynq_ehci_priv *priv = dev_get_priv(dev); - priv->ehci = (struct usb_ehci *)devfdt_get_addr_ptr(dev); + priv->ehci = dev_read_addr_ptr(dev); if (!priv->ehci) return -EINVAL; diff --git a/drivers/watchdog/ast_wdt.c b/drivers/watchdog/ast_wdt.c index 7e11465a57..b4aef545e8 100644 --- a/drivers/watchdog/ast_wdt.c +++ b/drivers/watchdog/ast_wdt.c @@ -90,7 +90,7 @@ static int ast_wdt_ofdata_to_platdata(struct udevice *dev) { struct ast_wdt_priv *priv = dev_get_priv(dev); - priv->regs = devfdt_get_addr_ptr(dev); + priv->regs = dev_read_addr_ptr(dev); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs);