diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdcore.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 89c1e5ddc7c2..fdd6ae859397 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -585,6 +585,8 @@ done: | |||
585 | return ((count < begin+len-off) ? count : begin+len-off); | 585 | return ((count < begin+len-off) ? count : begin+len-off); |
586 | } | 586 | } |
587 | 587 | ||
588 | #endif /* CONFIG_PROC_FS */ | ||
589 | |||
588 | /*====================================================================*/ | 590 | /*====================================================================*/ |
589 | /* Init code */ | 591 | /* Init code */ |
590 | 592 | ||
@@ -596,24 +598,25 @@ static int __init init_mtd(void) | |||
596 | pr_err("Error creating mtd class.\n"); | 598 | pr_err("Error creating mtd class.\n"); |
597 | return PTR_ERR(mtd_class); | 599 | return PTR_ERR(mtd_class); |
598 | } | 600 | } |
601 | #ifdef CONFIG_PROC_FS | ||
599 | if ((proc_mtd = create_proc_entry( "mtd", 0, NULL ))) | 602 | if ((proc_mtd = create_proc_entry( "mtd", 0, NULL ))) |
600 | proc_mtd->read_proc = mtd_read_proc; | 603 | proc_mtd->read_proc = mtd_read_proc; |
604 | #endif /* CONFIG_PROC_FS */ | ||
601 | return 0; | 605 | return 0; |
602 | } | 606 | } |
603 | 607 | ||
604 | static void __exit cleanup_mtd(void) | 608 | static void __exit cleanup_mtd(void) |
605 | { | 609 | { |
610 | #ifdef CONFIG_PROC_FS | ||
606 | if (proc_mtd) | 611 | if (proc_mtd) |
607 | remove_proc_entry( "mtd", NULL); | 612 | remove_proc_entry( "mtd", NULL); |
613 | #endif /* CONFIG_PROC_FS */ | ||
608 | class_destroy(mtd_class); | 614 | class_destroy(mtd_class); |
609 | } | 615 | } |
610 | 616 | ||
611 | module_init(init_mtd); | 617 | module_init(init_mtd); |
612 | module_exit(cleanup_mtd); | 618 | module_exit(cleanup_mtd); |
613 | 619 | ||
614 | #endif /* CONFIG_PROC_FS */ | ||
615 | |||
616 | |||
617 | MODULE_LICENSE("GPL"); | 620 | MODULE_LICENSE("GPL"); |
618 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); | 621 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); |
619 | MODULE_DESCRIPTION("Core MTD registration and access routines"); | 622 | MODULE_DESCRIPTION("Core MTD registration and access routines"); |