diff options
-rw-r--r-- | drivers/mtd/mtdcore.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 9c3813486a1a..9905870f56e5 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -19,9 +19,7 @@ | |||
19 | #include <linux/ioctl.h> | 19 | #include <linux/ioctl.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/mtd/compatmac.h> | 21 | #include <linux/mtd/compatmac.h> |
22 | #ifdef CONFIG_PROC_FS | ||
23 | #include <linux/proc_fs.h> | 22 | #include <linux/proc_fs.h> |
24 | #endif | ||
25 | 23 | ||
26 | #include <linux/mtd/mtd.h> | 24 | #include <linux/mtd/mtd.h> |
27 | 25 | ||
@@ -296,10 +294,11 @@ EXPORT_SYMBOL(unregister_mtd_user); | |||
296 | EXPORT_SYMBOL(default_mtd_writev); | 294 | EXPORT_SYMBOL(default_mtd_writev); |
297 | EXPORT_SYMBOL(default_mtd_readv); | 295 | EXPORT_SYMBOL(default_mtd_readv); |
298 | 296 | ||
297 | #ifdef CONFIG_PROC_FS | ||
298 | |||
299 | /*====================================================================*/ | 299 | /*====================================================================*/ |
300 | /* Support for /proc/mtd */ | 300 | /* Support for /proc/mtd */ |
301 | 301 | ||
302 | #ifdef CONFIG_PROC_FS | ||
303 | static struct proc_dir_entry *proc_mtd; | 302 | static struct proc_dir_entry *proc_mtd; |
304 | 303 | ||
305 | static inline int mtd_proc_info (char *buf, int i) | 304 | static inline int mtd_proc_info (char *buf, int i) |
@@ -344,31 +343,27 @@ done: | |||
344 | return ((count < begin+len-off) ? count : begin+len-off); | 343 | return ((count < begin+len-off) ? count : begin+len-off); |
345 | } | 344 | } |
346 | 345 | ||
347 | #endif /* CONFIG_PROC_FS */ | ||
348 | |||
349 | /*====================================================================*/ | 346 | /*====================================================================*/ |
350 | /* Init code */ | 347 | /* Init code */ |
351 | 348 | ||
352 | static int __init init_mtd(void) | 349 | static int __init init_mtd(void) |
353 | { | 350 | { |
354 | #ifdef CONFIG_PROC_FS | ||
355 | if ((proc_mtd = create_proc_entry( "mtd", 0, NULL ))) | 351 | if ((proc_mtd = create_proc_entry( "mtd", 0, NULL ))) |
356 | proc_mtd->read_proc = mtd_read_proc; | 352 | proc_mtd->read_proc = mtd_read_proc; |
357 | #endif | ||
358 | return 0; | 353 | return 0; |
359 | } | 354 | } |
360 | 355 | ||
361 | static void __exit cleanup_mtd(void) | 356 | static void __exit cleanup_mtd(void) |
362 | { | 357 | { |
363 | #ifdef CONFIG_PROC_FS | ||
364 | if (proc_mtd) | 358 | if (proc_mtd) |
365 | remove_proc_entry( "mtd", NULL); | 359 | remove_proc_entry( "mtd", NULL); |
366 | #endif | ||
367 | } | 360 | } |
368 | 361 | ||
369 | module_init(init_mtd); | 362 | module_init(init_mtd); |
370 | module_exit(cleanup_mtd); | 363 | module_exit(cleanup_mtd); |
371 | 364 | ||
365 | #endif /* CONFIG_PROC_FS */ | ||
366 | |||
372 | 367 | ||
373 | MODULE_LICENSE("GPL"); | 368 | MODULE_LICENSE("GPL"); |
374 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); | 369 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); |