Skip to content

Commit 9cc36bb

Browse files
Cédric Le Goaterozbenh
authored andcommitted
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>
1 parent 926e694 commit 9cc36bb

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎arch/powerpc/boot/of.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ typedef u32 __be32;
2323
#define cpu_to_be32(x) (x)
2424
#define be32_to_cpu(x) (x)
2525

26+
#define PROM_ERROR (-1u)
27+
2628
#endif /* _PPC_BOOT_OF_H_ */

‎arch/powerpc/boot/oflib.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int of_call_prom(const char *service, int nargs, int nret, ...)
5555
args.args[nargs+i] = 0;
5656

5757
if (prom(&args) < 0)
58-
return -1;
58+
return PROM_ERROR;
5959

6060
return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0;
6161
}
@@ -80,9 +80,9 @@ static int of_call_prom_ret(const char *service, int nargs, int nret,
8080
args.args[nargs+i] = 0;
8181

8282
if (prom(&args) < 0)
83-
return -1;
83+
return PROM_ERROR;
8484

85-
if (rets != (void *) 0)
85+
if (rets != NULL)
8686
for (i = 1; i < nret; ++i)
8787
rets[i-1] = be32_to_cpu(args.args[nargs+i]);
8888

0 commit comments

Comments
 (0)