mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhao Qiang <qiang.zhao@nxp.com>
To: <oss@buserror.net>
Cc: <pku.leo@gmail.com>, <xiaobo.xie@nxp.com>,
	<linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
	Zhao Qiang <qiang.zhao@nxp.com>
Subject: [PATCH v6 1/2] qe: modify get_qe_base function
Date: Fri, 23 Sep 2016 10:20:31 +0800	[thread overview]
Message-ID: <1474597232-33397-1-git-send-email-qiang.zhao@nxp.com> (raw)

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
Changes for v6:
	- 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

             reply	other threads:[~2016-09-23  3:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23  2:20 Zhao Qiang [this message]
2016-09-23  2:20 ` [PATCH v6 2/2] QE: remove PPCisms for QE Zhao Qiang
2016-09-25  4:14   ` [v6,2/2] " Scott Wood
2016-09-25  4:19     ` Scott Wood
2016-09-26  1:46       ` Qiang Zhao
2016-09-26 23:11         ` Scott Wood
2016-09-27  3:13           ` Qiang Zhao

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=1474597232-33397-1-git-send-email-qiang.zhao@nxp.com \
    --to=qiang.zhao@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oss@buserror.net \
    --cc=pku.leo@gmail.com \
    --cc=xiaobo.xie@nxp.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®