[MTD] sysfs support should not depend on CONFIG_PROC_FS
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon Apr 6 10:59:01 EDT 2009
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=45b09076149f1360e15919ca7e004e8d3810a0f7
Commit: 45b09076149f1360e15919ca7e004e8d3810a0f7
Parent: c451c7c4c9c4f59c7808a7d397d32bef160c14d9
Author: Kevin Cernekee <kpc.mtd at gmail.com>
AuthorDate: Sat Apr 4 11:03:04 2009 -0700
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Apr 4 22:52:08 2009 +0100
[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 at gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
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 89c1e5d..fdd6ae8 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -585,6 +585,8 @@ done:
return ((count < begin+len-off) ? count : begin+len-off);
}
+#endif /* CONFIG_PROC_FS */
+
/*====================================================================*/
/* Init code */
@@ -596,24 +598,25 @@ static int __init init_mtd(void)
pr_err("Error creating mtd class.\n");
return PTR_ERR(mtd_class);
}
+#ifdef CONFIG_PROC_FS
if ((proc_mtd = create_proc_entry( "mtd", 0, NULL )))
proc_mtd->read_proc = mtd_read_proc;
+#endif /* CONFIG_PROC_FS */
return 0;
}
static void __exit cleanup_mtd(void)
{
+#ifdef CONFIG_PROC_FS
if (proc_mtd)
remove_proc_entry( "mtd", NULL);
+#endif /* CONFIG_PROC_FS */
class_destroy(mtd_class);
}
module_init(init_mtd);
module_exit(cleanup_mtd);
-#endif /* CONFIG_PROC_FS */
-
-
MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2 at infradead.org>");
MODULE_DESCRIPTION("Core MTD registration and access routines");
More information about the linux-mtd-cvs
mailing list