[PATCH] unbreaking pseries nvram driver
Olaf Hering
olh at suse.de
Tue Feb 17 07:49:32 EST 2004
rtas_token returns an int, the rtas_call arguments are also an int. The
error code returned by rtas_token is also an int.
So, why the unsigned int?
--- /tmp/linuxppc64-2.5/arch/ppc64/kernel/pSeries_nvram.c 2004-02-12 03:47:53.000000000 +0000
+++ ./arch/ppc64/kernel/pSeries_nvram.c 2004-02-16 20:45:12.000000000 +0000
@@ -29,7 +29,7 @@
#include <asm/machdep.h>
static unsigned int nvram_size;
-static unsigned int nvram_fetch, nvram_store;
+static int nvram_fetch, nvram_store;
static char nvram_buf[NVRW_CNT]; /* assume this is in the first 4GB */
static spinlock_t nvram_lock = SPIN_LOCK_UNLOCKED;
@@ -41,7 +41,7 @@ static ssize_t pSeries_nvram_read(char *
unsigned long flags;
char *p = buf;
- if (nvram_size == 0 || nvram_fetch)
+ if (nvram_size == 0 || nvram_fetch == RTAS_UNKNOWN_SERVICE)
return -ENODEV;
if (*index >= nvram_size)
@@ -83,7 +83,7 @@ static ssize_t pSeries_nvram_write(char
unsigned long flags;
const char *p = buf;
- if (nvram_size == 0 || nvram_store)
+ if (nvram_size == 0 || nvram_store == RTAS_UNKNOWN_SERVICE)
return -ENODEV;
if (*index >= nvram_size)
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list