diff options
author | Kevin Cernekee <kpc.mtd@gmail.com> | 2009-04-04 14:03:04 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-04-04 17:52:08 -0400 |
commit | 45b09076149f1360e15919ca7e004e8d3810a0f7 (patch) | |
tree | b6e60e99ef7a7d516bd36fa8cd6f1bb6d21e1e7f /drivers/mtd/mtdcore.c | |
parent | c451c7c4c9c4f59c7808a7d397d32bef160c14d9 (diff) |
[MTD] sysfs support should not depend on CONFIG_PROC_FS
Move the driver model init code out of the "#ifdef CONFIG_PROC_FS"
block.
Tested with both values of CONFIG_PROC_FS . Tested with CONFIG_MTD=m .
Issue was reported here: http://lkml.org/lkml/2009/4/4/107
Signed-off-by: Kevin Cernekee <kpc.mtd@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-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"); |