powerpc/kernel: Use of_property_read_u32() in rtas_initialize()
This uses of_property_read_u32() in rtas_initialize() so that we needn't explicitly care the CPU's endian. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
dbecd50930
commit
de6d2d1b7b
1 changed files with 9 additions and 11 deletions
|
|
@ -1145,7 +1145,8 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
|
||||||
void __init rtas_initialize(void)
|
void __init rtas_initialize(void)
|
||||||
{
|
{
|
||||||
unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
|
unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
|
||||||
const __be32 *basep, *entryp, *sizep;
|
u32 base, size, entry;
|
||||||
|
int no_base, no_size, no_entry;
|
||||||
|
|
||||||
/* Get RTAS dev node and fill up our "rtas" structure with infos
|
/* Get RTAS dev node and fill up our "rtas" structure with infos
|
||||||
* about it.
|
* about it.
|
||||||
|
|
@ -1154,20 +1155,17 @@ void __init rtas_initialize(void)
|
||||||
if (!rtas.dev)
|
if (!rtas.dev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
basep = of_get_property(rtas.dev, "linux,rtas-base", NULL);
|
no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base);
|
||||||
sizep = of_get_property(rtas.dev, "rtas-size", NULL);
|
no_size = of_property_read_u32(rtas.dev, "rtas-size", &size);
|
||||||
if (basep == NULL || sizep == NULL) {
|
if (no_base || no_size) {
|
||||||
rtas.dev = NULL;
|
rtas.dev = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtas.base = __be32_to_cpu(*basep);
|
rtas.base = base;
|
||||||
rtas.size = __be32_to_cpu(*sizep);
|
rtas.size = size;
|
||||||
entryp = of_get_property(rtas.dev, "linux,rtas-entry", NULL);
|
no_entry = of_property_read_u32(rtas.dev, "linux,rtas-entry", &entry);
|
||||||
if (entryp == NULL) /* Ugh */
|
rtas.entry = no_entry ? rtas.base : entry;
|
||||||
rtas.entry = rtas.base;
|
|
||||||
else
|
|
||||||
rtas.entry = __be32_to_cpu(*entryp);
|
|
||||||
|
|
||||||
/* If RTAS was found, allocate the RMO buffer for it and look for
|
/* If RTAS was found, allocate the RMO buffer for it and look for
|
||||||
* the stop-self token if any
|
* the stop-self token if any
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue