diff options
author | Cédric Le Goater <clg@fr.ibm.com> | 2014-04-24 03:23:29 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-04-28 03:35:39 -0400 |
commit | 9cc36bb0aca622539be59266012d8be4346f0996 (patch) | |
tree | 613f836ac50d94eeed3723105451789ede639d02 | |
parent | 926e6940f54313813d177b5cfb9ec31a441cd259 (diff) |
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: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/boot/of.h | 2 | ||||
-rw-r--r-- | arch/powerpc/boot/oflib.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/boot/of.h b/arch/powerpc/boot/of.h index 40d95bf7402b..0f058ef69521 100644 --- a/arch/powerpc/boot/of.h +++ b/arch/powerpc/boot/of.h | |||
@@ -23,4 +23,6 @@ typedef u32 __be32; | |||
23 | #define cpu_to_be32(x) (x) | 23 | #define cpu_to_be32(x) (x) |
24 | #define be32_to_cpu(x) (x) | 24 | #define be32_to_cpu(x) (x) |
25 | 25 | ||
26 | #define PROM_ERROR (-1u) | ||
27 | |||
26 | #endif /* _PPC_BOOT_OF_H_ */ | 28 | #endif /* _PPC_BOOT_OF_H_ */ |
diff --git a/arch/powerpc/boot/oflib.c b/arch/powerpc/boot/oflib.c index 0f72b1a42133..7f61f2eb5653 100644 --- a/arch/powerpc/boot/oflib.c +++ b/arch/powerpc/boot/oflib.c | |||
@@ -55,7 +55,7 @@ int of_call_prom(const char *service, int nargs, int nret, ...) | |||
55 | args.args[nargs+i] = 0; | 55 | args.args[nargs+i] = 0; |
56 | 56 | ||
57 | if (prom(&args) < 0) | 57 | if (prom(&args) < 0) |
58 | return -1; | 58 | return PROM_ERROR; |
59 | 59 | ||
60 | return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0; | 60 | return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0; |
61 | } | 61 | } |
@@ -80,9 +80,9 @@ static int of_call_prom_ret(const char *service, int nargs, int nret, | |||
80 | args.args[nargs+i] = 0; | 80 | args.args[nargs+i] = 0; |
81 | 81 | ||
82 | if (prom(&args) < 0) | 82 | if (prom(&args) < 0) |
83 | return -1; | 83 | return PROM_ERROR; |
84 | 84 | ||
85 | if (rets != (void *) 0) | 85 | if (rets != NULL) |
86 | for (i = 1; i < nret; ++i) | 86 | for (i = 1; i < nret; ++i) |
87 | rets[i-1] = be32_to_cpu(args.args[nargs+i]); | 87 | rets[i-1] = be32_to_cpu(args.args[nargs+i]); |
88 | 88 | ||