Commit 9cc36bb0 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Benjamin Herrenschmidt

powerpc/boot: Add PROM_ERROR define in oflib

This is mostly useful to make to the boot wrapper code closer with
the kernel code in prom_init.
Signed-off-by: default avatarCédric Le Goater <clg@fr.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 926e6940
...@@ -23,4 +23,6 @@ typedef u32 __be32; ...@@ -23,4 +23,6 @@ typedef u32 __be32;
#define cpu_to_be32(x) (x) #define cpu_to_be32(x) (x)
#define be32_to_cpu(x) (x) #define be32_to_cpu(x) (x)
#define PROM_ERROR (-1u)
#endif /* _PPC_BOOT_OF_H_ */ #endif /* _PPC_BOOT_OF_H_ */
...@@ -55,7 +55,7 @@ int of_call_prom(const char *service, int nargs, int nret, ...) ...@@ -55,7 +55,7 @@ int of_call_prom(const char *service, int nargs, int nret, ...)
args.args[nargs+i] = 0; args.args[nargs+i] = 0;
if (prom(&args) < 0) if (prom(&args) < 0)
return -1; return PROM_ERROR;
return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0; return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0;
} }
...@@ -80,9 +80,9 @@ static int of_call_prom_ret(const char *service, int nargs, int nret, ...@@ -80,9 +80,9 @@ static int of_call_prom_ret(const char *service, int nargs, int nret,
args.args[nargs+i] = 0; args.args[nargs+i] = 0;
if (prom(&args) < 0) if (prom(&args) < 0)
return -1; return PROM_ERROR;
if (rets != (void *) 0) if (rets != NULL)
for (i = 1; i < nret; ++i) for (i = 1; i < nret; ++i)
rets[i-1] = be32_to_cpu(args.args[nargs+i]); rets[i-1] = be32_to_cpu(args.args[nargs+i]);
......
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