Skip to content

Commit

Permalink
mtd: mtdcore: remove few useless #ifdef's
Browse files Browse the repository at this point in the history
Remove a couple of useles '#ifdef CONFIG_PROC_FS's around procfs functions
which anyway turn into empty function in 'proc_fs.h' file when CONFIG_PROC_FS
is not defined.

Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
dedekind authored and David Woodhouse committed Apr 5, 2013
1 parent c188a14 commit 93e5621
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/mtd/mtdcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,6 @@ EXPORT_SYMBOL_GPL(mtd_kmalloc_up_to);
/*====================================================================*/
/* Support for /proc/mtd */

static struct proc_dir_entry *proc_mtd;

static int mtd_proc_show(struct seq_file *m, void *v)
{
struct mtd_info *mtd;
Expand Down Expand Up @@ -1163,6 +1161,8 @@ static int __init mtd_bdi_init(struct backing_dev_info *bdi, const char *name)
return ret;
}

static struct proc_dir_entry *proc_mtd;

static int __init init_mtd(void)
{
int ret;
Expand All @@ -1183,9 +1183,8 @@ static int __init init_mtd(void)
if (ret)
goto err_bdi3;

#ifdef CONFIG_PROC_FS
proc_mtd = proc_create("mtd", 0, NULL, &mtd_proc_ops);
#endif /* CONFIG_PROC_FS */

return 0;

err_bdi3:
Expand All @@ -1201,10 +1200,8 @@ static int __init init_mtd(void)

static void __exit cleanup_mtd(void)
{
#ifdef CONFIG_PROC_FS
if (proc_mtd)
remove_proc_entry( "mtd", NULL);
#endif /* CONFIG_PROC_FS */
remove_proc_entry("mtd", NULL);
class_unregister(&mtd_class);
bdi_destroy(&mtd_bdi_unmappable);
bdi_destroy(&mtd_bdi_ro_mappable);
Expand Down

0 comments on commit 93e5621

Please sign in to comment.