X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fnwflash.c;h=8cffbf0d6c517feca4058c49498e366e56e40d84;hb=a5a3d8204ccf9e1ecbfa2bffe4785290e705a4f4;hp=e75381ec15618384c17cd7213a83539cca71e55e;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c index e75381ec1..8cffbf0d6 100644 --- a/drivers/char/nwflash.c +++ b/drivers/char/nwflash.c @@ -43,7 +43,11 @@ static void kick_open(void); static int get_flash_id(void); static int erase_block(int nBlock); -static int write_block(unsigned long p, const char __user *buf, int count); +static int write_block(unsigned long p, const char *buf, int count); +static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cmd, unsigned long arg); +static ssize_t flash_read(struct file *file, char *buf, size_t count, loff_t * ppos); +static ssize_t flash_write(struct file *file, const char *buf, size_t count, loff_t * ppos); +static loff_t flash_llseek(struct file *file, loff_t offset, int orig); #define KFLASH_SIZE 1024*1024 //1 Meg #define KFLASH_SIZE4 4*1024*1024 //4 Meg @@ -128,16 +132,15 @@ static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cm return 0; } -static ssize_t flash_read(struct file *file, char __user *buf, size_t size, - loff_t *ppos) +static ssize_t flash_read(struct file *file, char *buf, size_t size, loff_t * ppos) { unsigned long p = *ppos; unsigned int count = size; int ret = 0; if (flashdebug) - printk(KERN_DEBUG "flash_read: flash_read: offset=0x%lX, " - "buffer=%p, count=0x%X.\n", p, buf, count); + printk(KERN_DEBUG "flash_read: flash_read: offset=0x%lX, buffer=%p, count=0x%X.\n", + p, buf, count); if (count) ret = -ENXIO; @@ -163,8 +166,7 @@ static ssize_t flash_read(struct file *file, char __user *buf, size_t size, return ret; } -static ssize_t flash_write(struct file *file, const char __user *buf, - size_t size, loff_t * ppos) +static ssize_t flash_write(struct file *file, const char *buf, size_t size, loff_t * ppos) { unsigned long p = *ppos; unsigned int count = size; @@ -242,9 +244,8 @@ static ssize_t flash_write(struct file *file, const char __user *buf, break; } if (flashdebug) - printk(KERN_DEBUG "flash_write: writing offset %lX, " - "from buf %p, bytes left %X.\n", p, buf, - count - written); + printk(KERN_DEBUG "flash_write: writing offset %lX, from buf " + "%p, bytes left %X.\n", p, buf, count - written); /* * write_block will limit write to space left in this block @@ -459,7 +460,7 @@ static int erase_block(int nBlock) /* * write_block will limit number of bytes written to the space in this block */ -static int write_block(unsigned long p, const char __user *buf, int count) +static int write_block(unsigned long p, const char *buf, int count) { volatile unsigned int c1; volatile unsigned int c2;