patch-2.4.3 linux/drivers/sbus/char/flash.c

Next file: linux/drivers/sbus/char/pcikbd.c
Previous file: linux/drivers/sbus/char/envctrl.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/sbus/char/flash.c linux/drivers/sbus/char/flash.c
@@ -1,4 +1,4 @@
-/* $Id: flash.c,v 1.22 2001/02/13 01:17:00 davem Exp $
+/* $Id: flash.c,v 1.23 2001/03/02 06:32:40 davem Exp $
  * flash.c: Allow mmap access to the OBP Flash, for OBP updates.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -106,12 +106,17 @@
 	   size_t count, loff_t *ppos)
 {
 	unsigned long p = file->f_pos;
+	int i;
 	
 	if (count > flash.read_size - p)
 		count = flash.read_size - p;
 
-	if (copy_to_user(buf, flash.read_base + p, count) < 0)
-		return -EFAULT;
+	for (i = 0; i < count; i++) {
+		u8 data = readb(flash.read_base + p + i);
+		if (put_user(data, buf))
+			return -EFAULT;
+		buf++;
+	}
 
 	file->f_pos += count;
 	return count;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)