diff options
author | Zhao Qiang <qiang.zhao@nxp.com> | 2016-09-23 10:20:31 +0800 |
---|---|---|
committer | Scott Wood <oss@buserror.net> | 2016-09-24 23:01:17 -0500 |
commit | 5066943a5170838e58e07163d32ba45b0b360417 (patch) | |
tree | db6187ffb7ba966737e8d73c8dbd54c9c23b0d18 /drivers/soc | |
parent | 40f1ebd4e0997e81ac2eb3b2f64d6133051afe86 (diff) |
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: Zhao Qiang <qiang.zhao@nxp.com>
Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/fsl/qe/qe.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 7026507e6f1d..2707a827261b 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; |