If a claim fails, the Pegasos firmware pretends it never even made it
into the prom, rather than indicating that it tried and failed.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/arch/powerpc/boot/prom.c b/arch/powerpc/boot/prom.c
index 4bea2f4..e8a6304 100644
--- a/arch/powerpc/boot/prom.c
+++ b/arch/powerpc/boot/prom.c
@@ -116,6 +116,7 @@ finddevice(const char *name)
void *
claim(unsigned long virt, unsigned long size, unsigned long align)
{
+ int ret;
struct prom_args {
char *service;
int nargs;@@ -132,7 +133,11 @@ claim(unsigned long virt, unsigned long
args.virt = virt;
args.size = size;
args.align = align;
- (*prom)(&args);
+ ret = (*prom)(&args);
+ /* The original Pegasos II firmware claims that the call never made
+ it into the prom, rather than returning failure correctly */
+ if (ret)
+ return (void *)-1;
return args.ret;
}
--
dwmw2