vserver 1.9.3
[linux-2.6.git] / drivers / sbus / char / flash.c
index 61cf81f..0d42950 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/io.h>
 #include <asm/sbus.h>
 #include <asm/ebus.h>
+#include <asm/upa.h>
 
 static spinlock_t flash_lock = SPIN_LOCK_UNLOCKED;
 static struct {
@@ -105,7 +106,7 @@ flash_llseek(struct file *file, long long offset, int origin)
 }
 
 static ssize_t
-flash_read(struct file * file, char * buf,
+flash_read(struct file * file, char __user * buf,
           size_t count, loff_t *ppos)
 {
        unsigned long p = file->f_pos;
@@ -115,7 +116,7 @@ flash_read(struct file * file, char * buf,
                count = flash.read_size - p;
 
        for (i = 0; i < count; i++) {
-               u8 data = readb(flash.read_base + p + i);
+               u8 data = upa_readb(flash.read_base + p + i);
                if (put_user(data, buf))
                        return -EFAULT;
                buf++;
@@ -161,10 +162,10 @@ static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
 static int __init flash_init(void)
 {
        struct sbus_bus *sbus;
-       struct sbus_dev *sdev = 0;
+       struct sbus_dev *sdev = NULL;
 #ifdef CONFIG_PCI
        struct linux_ebus *ebus;
-       struct linux_ebus_device *edev = 0;
+       struct linux_ebus_device *edev = NULL;
        struct linux_prom_registers regs[2];
        int len, nregs;
 #endif