diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:10:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:10:44 -0500 |
commit | a5a64498c194c82ecad3a2d67cff6231cda8d3dd (patch) | |
tree | 723d5d81419f9960b8d30ed9a2ece8a58d6c4328 /drivers/mtd/mtdchar.c | |
parent | bb93d802ae5c1949977cc6da247b218240677f11 (diff) | |
parent | f7160c7573615ec82c691e294cf80d920b5d588d (diff) |
Merge commit 'v2.6.28-rc4' into timers/rtc
Conflicts:
drivers/rtc/rtc-cmos.c
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r-- | drivers/mtd/mtdchar.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 1c74762dec89..bcffeda2df3d 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -96,7 +96,7 @@ static int mtd_open(struct inode *inode, struct file *file) | |||
96 | return -ENODEV; | 96 | return -ENODEV; |
97 | 97 | ||
98 | /* You can't open the RO devices RW */ | 98 | /* You can't open the RO devices RW */ |
99 | if ((file->f_mode & 2) && (minor & 1)) | 99 | if ((file->f_mode & FMODE_WRITE) && (minor & 1)) |
100 | return -EACCES; | 100 | return -EACCES; |
101 | 101 | ||
102 | lock_kernel(); | 102 | lock_kernel(); |
@@ -114,7 +114,7 @@ static int mtd_open(struct inode *inode, struct file *file) | |||
114 | } | 114 | } |
115 | 115 | ||
116 | /* You can't open it RW if it's not a writeable device */ | 116 | /* You can't open it RW if it's not a writeable device */ |
117 | if ((file->f_mode & 2) && !(mtd->flags & MTD_WRITEABLE)) { | 117 | if ((file->f_mode & FMODE_WRITE) && !(mtd->flags & MTD_WRITEABLE)) { |
118 | put_mtd_device(mtd); | 118 | put_mtd_device(mtd); |
119 | ret = -EACCES; | 119 | ret = -EACCES; |
120 | goto out; | 120 | goto out; |
@@ -144,7 +144,7 @@ static int mtd_close(struct inode *inode, struct file *file) | |||
144 | DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n"); | 144 | DEBUG(MTD_DEBUG_LEVEL0, "MTD_close\n"); |
145 | 145 | ||
146 | /* Only sync if opened RW */ | 146 | /* Only sync if opened RW */ |
147 | if ((file->f_mode & 2) && mtd->sync) | 147 | if ((file->f_mode & FMODE_WRITE) && mtd->sync) |
148 | mtd->sync(mtd); | 148 | mtd->sync(mtd); |
149 | 149 | ||
150 | put_mtd_device(mtd); | 150 | put_mtd_device(mtd); |
@@ -348,7 +348,7 @@ static void mtdchar_erase_callback (struct erase_info *instr) | |||
348 | wake_up((wait_queue_head_t *)instr->priv); | 348 | wake_up((wait_queue_head_t *)instr->priv); |
349 | } | 349 | } |
350 | 350 | ||
351 | #if defined(CONFIG_MTD_OTP) || defined(CONFIG_MTD_ONENAND_OTP) | 351 | #ifdef CONFIG_HAVE_MTD_OTP |
352 | static int otp_select_filemode(struct mtd_file_info *mfi, int mode) | 352 | static int otp_select_filemode(struct mtd_file_info *mfi, int mode) |
353 | { | 353 | { |
354 | struct mtd_info *mtd = mfi->mtd; | 354 | struct mtd_info *mtd = mfi->mtd; |
@@ -443,7 +443,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
443 | { | 443 | { |
444 | struct erase_info *erase; | 444 | struct erase_info *erase; |
445 | 445 | ||
446 | if(!(file->f_mode & 2)) | 446 | if(!(file->f_mode & FMODE_WRITE)) |
447 | return -EPERM; | 447 | return -EPERM; |
448 | 448 | ||
449 | erase=kzalloc(sizeof(struct erase_info),GFP_KERNEL); | 449 | erase=kzalloc(sizeof(struct erase_info),GFP_KERNEL); |
@@ -497,7 +497,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
497 | struct mtd_oob_buf __user *user_buf = argp; | 497 | struct mtd_oob_buf __user *user_buf = argp; |
498 | uint32_t retlen; | 498 | uint32_t retlen; |
499 | 499 | ||
500 | if(!(file->f_mode & 2)) | 500 | if(!(file->f_mode & FMODE_WRITE)) |
501 | return -EPERM; | 501 | return -EPERM; |
502 | 502 | ||
503 | if (copy_from_user(&buf, argp, sizeof(struct mtd_oob_buf))) | 503 | if (copy_from_user(&buf, argp, sizeof(struct mtd_oob_buf))) |
@@ -665,7 +665,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
665 | break; | 665 | break; |
666 | } | 666 | } |
667 | 667 | ||
668 | #if defined(CONFIG_MTD_OTP) || defined(CONFIG_MTD_ONENAND_OTP) | 668 | #ifdef CONFIG_HAVE_MTD_OTP |
669 | case OTPSELECT: | 669 | case OTPSELECT: |
670 | { | 670 | { |
671 | int mode; | 671 | int mode; |