aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdcore.c
diff options
context:
space:
mode:
authorKevin Cernekee <kpc.mtd@gmail.com>2009-04-04 14:03:04 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-04-04 17:52:08 -0400
commit45b09076149f1360e15919ca7e004e8d3810a0f7 (patch)
treeb6e60e99ef7a7d516bd36fa8cd6f1bb6d21e1e7f /drivers/mtd/mtdcore.c
parentc451c7c4c9c4f59c7808a7d397d32bef160c14d9 (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.c9
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
604static void __exit cleanup_mtd(void) 608static 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
611module_init(init_mtd); 617module_init(init_mtd);
612module_exit(cleanup_mtd); 618module_exit(cleanup_mtd);
613 619
614#endif /* CONFIG_PROC_FS */
615
616
617MODULE_LICENSE("GPL"); 620MODULE_LICENSE("GPL");
618MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); 621MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
619MODULE_DESCRIPTION("Core MTD registration and access routines"); 622MODULE_DESCRIPTION("Core MTD registration and access routines");