Commit 5066943a authored by Zhao Qiang's avatar Zhao Qiang Committed by Scott Wood

soc/fsl/qe: Use of_adress_to_resource() in get_qe_base()

modify get_qe_base function with of_address_to_resource
instead of of_get_property and of_translate_address.
Signed-off-by: default avatarZhao Qiang <qiang.zhao@nxp.com>
Signed-off-by: default avatarScott Wood <oss@buserror.net>
parent 40f1ebd4
...@@ -69,8 +69,8 @@ static phys_addr_t qebase = -1; ...@@ -69,8 +69,8 @@ static phys_addr_t qebase = -1;
phys_addr_t get_qe_base(void) phys_addr_t get_qe_base(void)
{ {
struct device_node *qe; struct device_node *qe;
int size; int ret;
const u32 *prop; struct resource res;
if (qebase != -1) if (qebase != -1)
return qebase; return qebase;
...@@ -82,9 +82,9 @@ phys_addr_t get_qe_base(void) ...@@ -82,9 +82,9 @@ phys_addr_t get_qe_base(void)
return qebase; return qebase;
} }
prop = of_get_property(qe, "reg", &size); ret = of_address_to_resource(qe, 0, &res);
if (prop && size >= sizeof(*prop)) if (!ret)
qebase = of_translate_address(qe, prop); qebase = res.start;
of_node_put(qe); of_node_put(qe);
return qebase; return qebase;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment