[POWERPC] qe_lib: fix few fluffy negligences
One is intoduced by me (of_node_put() absence) and another was present already (not checking for NULL). Found by Stephen Rothwell. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
parent
e1664ee9f3
commit
d8985fd2b8
@ -66,7 +66,7 @@ phys_addr_t get_qe_base(void)
|
|||||||
{
|
{
|
||||||
struct device_node *qe;
|
struct device_node *qe;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
const void *prop;
|
const u32 *prop;
|
||||||
|
|
||||||
if (qebase != -1)
|
if (qebase != -1)
|
||||||
return qebase;
|
return qebase;
|
||||||
@ -79,6 +79,7 @@ phys_addr_t get_qe_base(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
prop = of_get_property(qe, "reg", &size);
|
prop = of_get_property(qe, "reg", &size);
|
||||||
|
if (prop && size >= sizeof(*prop))
|
||||||
qebase = of_translate_address(qe, prop);
|
qebase = of_translate_address(qe, prop);
|
||||||
of_node_put(qe);
|
of_node_put(qe);
|
||||||
|
|
||||||
@ -172,10 +173,9 @@ unsigned int get_brg_clk(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
prop = of_get_property(qe, "brg-frequency", &size);
|
prop = of_get_property(qe, "brg-frequency", &size);
|
||||||
if (!prop || size != sizeof(*prop))
|
if (prop && size == sizeof(*prop))
|
||||||
return brg_clk;
|
|
||||||
|
|
||||||
brg_clk = *prop;
|
brg_clk = *prop;
|
||||||
|
|
||||||
of_node_put(qe);
|
of_node_put(qe);
|
||||||
|
|
||||||
return brg_clk;
|
return brg_clk;
|
||||||
|
Loading…
Reference in New Issue
Block a user