Patchwork [1/2] mtd/maps: uclinux: fix building when partition support is disabled

login
register
mail settings
Submitter Mike Frysinger
Date May 26, 2009, 9:46 a.m.
Message ID <1243331191-11445-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/27637/
State New
Headers show

Comments

Mike Frysinger - May 26, 2009, 9:46 a.m.
From: Timofei Bondarenko <tim@ipi.ac.ru>

The uClinux map driver doesn't even use partitions, so we shouldn't require
it in order to work properly.

Signed-off-by: Timofei Bondarenko <tim@ipi.ac.ru>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
CC: Greg Ungerer <gerg@uclinux.org>
CC: uclinux-dev@uclinux.org
CC: linux-mtd@lists.infradead.org
---
 drivers/mtd/maps/uclinux.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Greg Ungerer - June 10, 2009, 1:46 a.m.
Mike Frysinger wrote:
> From: Timofei Bondarenko <tim@ipi.ac.ru>
> 
> The uClinux map driver doesn't even use partitions, so we shouldn't require
> it in order to work properly.
> 
> Signed-off-by: Timofei Bondarenko <tim@ipi.ac.ru>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> CC: Greg Ungerer <gerg@uclinux.org>

Acked-by: Greg Ungerer <gerg@uclinux.org>


> CC: uclinux-dev@uclinux.org
> CC: linux-mtd@lists.infradead.org
> ---
>  drivers/mtd/maps/uclinux.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
> index 81756e3..57699c2 100644
> --- a/drivers/mtd/maps/uclinux.c
> +++ b/drivers/mtd/maps/uclinux.c
> @@ -87,7 +87,11 @@ static int __init uclinux_mtd_init(void)
>  	mtd->priv = mapp;
>  
>  	uclinux_ram_mtdinfo = mtd;
> +#ifdef CONFIG_MTD_PARTITIONS
>  	add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS);
> +#else
> +	add_mtd_device(mtd);
> +#endif
>  
>  	return(0);
>  }
> @@ -97,7 +101,11 @@ static int __init uclinux_mtd_init(void)
>  static void __exit uclinux_mtd_cleanup(void)
>  {
>  	if (uclinux_ram_mtdinfo) {
> +#ifdef CONFIG_MTD_PARTITIONS
>  		del_mtd_partitions(uclinux_ram_mtdinfo);
> +#else
> +		del_mtd_device(uclinux_ram_mtdinfo);
> +#endif
>  		map_destroy(uclinux_ram_mtdinfo);
>  		uclinux_ram_mtdinfo = NULL;
>  	}

Patch

diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
index 81756e3..57699c2 100644
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -87,7 +87,11 @@  static int __init uclinux_mtd_init(void)
 	mtd->priv = mapp;
 
 	uclinux_ram_mtdinfo = mtd;
+#ifdef CONFIG_MTD_PARTITIONS
 	add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS);
+#else
+	add_mtd_device(mtd);
+#endif
 
 	return(0);
 }
@@ -97,7 +101,11 @@  static int __init uclinux_mtd_init(void)
 static void __exit uclinux_mtd_cleanup(void)
 {
 	if (uclinux_ram_mtdinfo) {
+#ifdef CONFIG_MTD_PARTITIONS
 		del_mtd_partitions(uclinux_ram_mtdinfo);
+#else
+		del_mtd_device(uclinux_ram_mtdinfo);
+#endif
 		map_destroy(uclinux_ram_mtdinfo);
 		uclinux_ram_mtdinfo = NULL;
 	}