linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 1/2] qe: modify get_qe_base function
@ 2016-07-25  5:43 Zhao Qiang
  2016-07-25  5:43 ` [PATCH v5 2/2] QE: remove PPCisms for QE Zhao Qiang
  0 siblings, 1 reply; 8+ messages in thread
From: Zhao Qiang @ 2016-07-25  5:43 UTC (permalink / raw)
  To: oss; +Cc: linuxppc-dev, linux-kernel, xiaobo.xie, Zhao Qiang

modify get_qe_base function with of_address_to_resource
instead of of_get_property and of_translate_address.

Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
---
Changes for v2:
	- na
Changes for v3:
	- na
Changes for v4:
	- na
Changes for v5:
	- na

 drivers/soc/fsl/qe/qe.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c
index 7026507..2707a82 100644
--- a/drivers/soc/fsl/qe/qe.c
+++ b/drivers/soc/fsl/qe/qe.c
@@ -69,8 +69,8 @@ static phys_addr_t qebase = -1;
 phys_addr_t get_qe_base(void)
 {
 	struct device_node *qe;
-	int size;
-	const u32 *prop;
+	int ret;
+	struct resource res;
 
 	if (qebase != -1)
 		return qebase;
@@ -82,9 +82,9 @@ phys_addr_t get_qe_base(void)
 			return qebase;
 	}
 
-	prop = of_get_property(qe, "reg", &size);
-	if (prop && size >= sizeof(*prop))
-		qebase = of_translate_address(qe, prop);
+	ret = of_address_to_resource(qe, 0, &res);
+	if (!ret)
+		qebase = res.start;
 	of_node_put(qe);
 
 	return qebase;
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-23  8:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-25  5:43 [PATCH v5 1/2] qe: modify get_qe_base function Zhao Qiang
2016-07-25  5:43 ` [PATCH v5 2/2] QE: remove PPCisms for QE Zhao Qiang
2016-09-19 20:13   ` Leo Li
2016-09-21  1:13     ` Qiang Zhao
2016-09-21 18:18       ` Leo Li
2016-09-22  1:43         ` Qiang Zhao
2016-09-22 19:38           ` Leo Li
2016-09-23  1:10             ` Qiang Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).