diff options
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r-- | drivers/mtd/mtdchar.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index c7292528c7bb..e0e59bf9b915 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -38,6 +38,8 @@ | |||
38 | 38 | ||
39 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
40 | 40 | ||
41 | #include "mtdcore.h" | ||
42 | |||
41 | static DEFINE_MUTEX(mtd_mutex); | 43 | static DEFINE_MUTEX(mtd_mutex); |
42 | 44 | ||
43 | /* | 45 | /* |
@@ -365,7 +367,6 @@ static void mtdchar_erase_callback (struct erase_info *instr) | |||
365 | wake_up((wait_queue_head_t *)instr->priv); | 367 | wake_up((wait_queue_head_t *)instr->priv); |
366 | } | 368 | } |
367 | 369 | ||
368 | #ifdef CONFIG_HAVE_MTD_OTP | ||
369 | static int otp_select_filemode(struct mtd_file_info *mfi, int mode) | 370 | static int otp_select_filemode(struct mtd_file_info *mfi, int mode) |
370 | { | 371 | { |
371 | struct mtd_info *mtd = mfi->mtd; | 372 | struct mtd_info *mtd = mfi->mtd; |
@@ -395,9 +396,6 @@ static int otp_select_filemode(struct mtd_file_info *mfi, int mode) | |||
395 | 396 | ||
396 | return 0; | 397 | return 0; |
397 | } | 398 | } |
398 | #else | ||
399 | # define otp_select_filemode(f,m) -EOPNOTSUPP | ||
400 | #endif | ||
401 | 399 | ||
402 | static int mtdchar_writeoob(struct file *file, struct mtd_info *mtd, | 400 | static int mtdchar_writeoob(struct file *file, struct mtd_info *mtd, |
403 | uint64_t start, uint32_t length, void __user *ptr, | 401 | uint64_t start, uint32_t length, void __user *ptr, |
@@ -890,7 +888,6 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) | |||
890 | break; | 888 | break; |
891 | } | 889 | } |
892 | 890 | ||
893 | #ifdef CONFIG_HAVE_MTD_OTP | ||
894 | case OTPSELECT: | 891 | case OTPSELECT: |
895 | { | 892 | { |
896 | int mode; | 893 | int mode; |
@@ -946,7 +943,6 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) | |||
946 | ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length); | 943 | ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length); |
947 | break; | 944 | break; |
948 | } | 945 | } |
949 | #endif | ||
950 | 946 | ||
951 | /* This ioctl is being deprecated - it truncates the ECC layout */ | 947 | /* This ioctl is being deprecated - it truncates the ECC layout */ |
952 | case ECCGETLAYOUT: | 948 | case ECCGETLAYOUT: |
@@ -1242,7 +1238,7 @@ static struct file_system_type mtd_inodefs_type = { | |||
1242 | }; | 1238 | }; |
1243 | MODULE_ALIAS_FS("mtd_inodefs"); | 1239 | MODULE_ALIAS_FS("mtd_inodefs"); |
1244 | 1240 | ||
1245 | static int __init init_mtdchar(void) | 1241 | int __init init_mtdchar(void) |
1246 | { | 1242 | { |
1247 | int ret; | 1243 | int ret; |
1248 | 1244 | ||
@@ -1268,18 +1264,10 @@ err_unregister_chdev: | |||
1268 | return ret; | 1264 | return ret; |
1269 | } | 1265 | } |
1270 | 1266 | ||
1271 | static void __exit cleanup_mtdchar(void) | 1267 | void __exit cleanup_mtdchar(void) |
1272 | { | 1268 | { |
1273 | unregister_filesystem(&mtd_inodefs_type); | 1269 | unregister_filesystem(&mtd_inodefs_type); |
1274 | __unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd"); | 1270 | __unregister_chrdev(MTD_CHAR_MAJOR, 0, 1 << MINORBITS, "mtd"); |
1275 | } | 1271 | } |
1276 | 1272 | ||
1277 | module_init(init_mtdchar); | ||
1278 | module_exit(cleanup_mtdchar); | ||
1279 | |||
1280 | MODULE_ALIAS_CHARDEV_MAJOR(MTD_CHAR_MAJOR); | ||
1281 | |||
1282 | MODULE_LICENSE("GPL"); | ||
1283 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); | ||
1284 | MODULE_DESCRIPTION("Direct character-device access to MTD devices"); | ||
1285 | MODULE_ALIAS_CHARDEV_MAJOR(MTD_CHAR_MAJOR); | 1273 | MODULE_ALIAS_CHARDEV_MAJOR(MTD_CHAR_MAJOR); |