nwflash.c (cf9ce948f47640797bd19980e1d99c6d17d0bdc3) | nwflash.c (b25472f9b96159cc0b9b7ed449448805973cd789) |
---|---|
1/* 2 * Flash memory interface rev.5 driver for the Intel 3 * Flash chips used on the NetWinder. 4 * 5 * 20/08/2000 RMK use __ioremap to map flash into virtual memory 6 * make a few more places use "volatile" 7 * 22/05/2001 RMK - Lock read against write 8 * - merge printk level changes (with mods) from Alan Cox. --- 263 unchanged lines hidden (view full) --- 272{ 273 loff_t ret; 274 275 mutex_lock(&flash_mutex); 276 if (flashdebug) 277 printk(KERN_DEBUG "flash_llseek: offset=0x%X, orig=0x%X.\n", 278 (unsigned int) offset, orig); 279 | 1/* 2 * Flash memory interface rev.5 driver for the Intel 3 * Flash chips used on the NetWinder. 4 * 5 * 20/08/2000 RMK use __ioremap to map flash into virtual memory 6 * make a few more places use "volatile" 7 * 22/05/2001 RMK - Lock read against write 8 * - merge printk level changes (with mods) from Alan Cox. --- 263 unchanged lines hidden (view full) --- 272{ 273 loff_t ret; 274 275 mutex_lock(&flash_mutex); 276 if (flashdebug) 277 printk(KERN_DEBUG "flash_llseek: offset=0x%X, orig=0x%X.\n", 278 (unsigned int) offset, orig); 279 |
280 switch (orig) { 281 case 0: 282 if (offset < 0) { 283 ret = -EINVAL; 284 break; 285 } 286 287 if ((unsigned int) offset > gbFlashSize) { 288 ret = -EINVAL; 289 break; 290 } 291 292 file->f_pos = (unsigned int) offset; 293 ret = file->f_pos; 294 break; 295 case 1: 296 if ((file->f_pos + offset) > gbFlashSize) { 297 ret = -EINVAL; 298 break; 299 } 300 if ((file->f_pos + offset) < 0) { 301 ret = -EINVAL; 302 break; 303 } 304 file->f_pos += offset; 305 ret = file->f_pos; 306 break; 307 default: 308 ret = -EINVAL; 309 } | 280 ret = no_seek_end_llseek_size(file, offset, orig, gbFlashSize); |
310 mutex_unlock(&flash_mutex); 311 return ret; 312} 313 314 315/* 316 * assume that main Write routine did the parameter checking... 317 * so just go ahead and erase, what requested! --- 337 unchanged lines hidden --- | 281 mutex_unlock(&flash_mutex); 282 return ret; 283} 284 285 286/* 287 * assume that main Write routine did the parameter checking... 288 * so just go ahead and erase, what requested! --- 337 unchanged lines hidden --- |