mtd/drivers/mtd/chips cfi_cmdset_0020.c,1.11,1.12
David Woodhouse
dwmw2 at infradead.org
Mon Jul 12 09:51:10 EDT 2004
Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv24586
Modified Files:
cfi_cmdset_0020.c
Log Message:
Merge from 2.6: long vs. longlong, NULL, licence, add $Id$
Index: cfi_cmdset_0020.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0020.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- cfi_cmdset_0020.c 5 Jun 2004 10:20:38 -0000 1.11
+++ cfi_cmdset_0020.c 12 Jul 2004 13:51:07 -0000 1.12
@@ -4,6 +4,7 @@
*
* (C) 2000 Red Hat. GPL'd
*
+ * $Id$
*
* 10/10/2000 Nicolas Pitre <nico at cam.org>
* - completely revamped method functions so they are aware and
@@ -17,6 +18,7 @@
* - added a writev function
*/
+#include <linux/version.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -26,19 +28,18 @@
#include <asm/byteorder.h>
#include <linux/errno.h>
-#include <linux/init.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
-#include <linux/mtd/compatmac.h>
#include <linux/mtd/map.h>
#include <linux/mtd/cfi.h>
#include <linux/mtd/mtd.h>
+#include <linux/mtd/compatmac.h>
static int cfi_staa_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int cfi_staa_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
-static int cfi_staa_writev(struct mtd_info *mtd, const struct iovec *vecs,
+static int cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
unsigned long count, loff_t to, size_t *retlen);
static int cfi_staa_erase_varsize(struct mtd_info *, struct erase_info *);
static void cfi_staa_sync (struct mtd_info *);
@@ -461,7 +462,7 @@
/* Urgh. Chip not yet ready to talk to us. */
if (time_after(jiffies, timeo)) {
spin_unlock_bh(chip->mutex);
- printk(KERN_ERR "waiting for chip to be ready timed out in buffer write Xstatus = %x, status = %x\n",
+ printk(KERN_ERR "waiting for chip to be ready timed out in buffer write Xstatus = %x, status = %llx\n",
status, cfi_read(map, cmd_adr));
return -EIO;
}
@@ -514,11 +515,20 @@
/* Write data */
for (z = 0; z < len; z += CFIDEV_BUSWIDTH, buf += CFIDEV_BUSWIDTH) {
if (cfi_buswidth_is_1()) {
- map_write8 (map, *((__u8*)buf), adr+z);
+ u8 *b = (u8 *)buf;
+
+ map_write8 (map, *b++, adr+z);
+ buf = (const u_char *)b;
} else if (cfi_buswidth_is_2()) {
- map_write16 (map, *((__u16*)buf), adr+z);
+ u16 *b = (u16 *)buf;
+
+ map_write16 (map, *b++, adr+z);
+ buf = (const u_char *)b;
} else if (cfi_buswidth_is_4()) {
- map_write32 (map, *((__u32*)buf), adr+z);
+ u32 *b = (u32 *)buf;
+
+ map_write32 (map, *b++, adr+z);
+ buf = (const u_char *)b;
} else {
DISABLE_VPP(map);
return -EINVAL;
@@ -663,7 +673,7 @@
#define ECCBUF_DIV(x) ((x) & ~(ECCBUF_SIZE - 1))
#define ECCBUF_MOD(x) ((x) & (ECCBUF_SIZE - 1))
static int
-cfi_staa_writev(struct mtd_info *mtd, const struct iovec *vecs,
+cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
unsigned long count, loff_t to, size_t *retlen)
{
unsigned long i;
@@ -822,7 +832,7 @@
if (time_after(jiffies, timeo)) {
cfi_write(map, CMD(0x70), adr);
chip->state = FL_STATUS;
- printk(KERN_ERR "waiting for erase to complete timed out. Xstatus = %x, status = %x.\n", status, cfi_read(map, adr));
+ printk(KERN_ERR "waiting for erase to complete timed out. Xstatus = %x, status = %llx.\n", status, cfi_read(map, adr));
DISABLE_VPP(map);
spin_unlock_bh(chip->mutex);
return -EIO;
@@ -1108,7 +1118,7 @@
if (time_after(jiffies, timeo)) {
cfi_write(map, CMD(0x70), adr);
chip->state = FL_STATUS;
- printk(KERN_ERR "waiting for lock to complete timed out. Xstatus = %x, status = %x.\n", status, cfi_read(map, adr));
+ printk(KERN_ERR "waiting for lock to complete timed out. Xstatus = %x, status = %llx.\n", status, cfi_read(map, adr));
DISABLE_VPP(map);
spin_unlock_bh(chip->mutex);
return -EIO;
@@ -1257,7 +1267,7 @@
if (time_after(jiffies, timeo)) {
cfi_write(map, CMD(0x70), adr);
chip->state = FL_STATUS;
- printk(KERN_ERR "waiting for unlock to complete timed out. Xstatus = %x, status = %x.\n", status, cfi_read(map, adr));
+ printk(KERN_ERR "waiting for unlock to complete timed out. Xstatus = %x, status = %llx.\n", status, cfi_read(map, adr));
DISABLE_VPP(map);
spin_unlock_bh(chip->mutex);
return -EIO;
@@ -1423,3 +1433,5 @@
module_init(cfi_staa_init);
module_exit(cfi_staa_exit);
+
+MODULE_LICENSE("GPL");
More information about the linux-mtd-cvs
mailing list