aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/maps/physmap.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-12-01 14:23:40 -0800
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-12-10 16:10:05 +0000
commitdcb3e137ce9be1dfc86e306182b23e3ae5e239c4 (patch)
tree1cc0081df2565d12f47334f18941a67a32807fbb /drivers/mtd/maps/physmap.c
parentc4956ed6fab26347ab1a712727da84b2501ab2dd (diff)
[MTD] physmap: make physmap compat explicit
The current method for always showing physmap compat address, size, and width is a bit confusing. If length is set to 0, then the address and width are still shown but silently unused. The physmap code itself already has logic which sets compat based on length, so just pull that out and into the Kconfig to make everything clear. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Bryan Wu <Bryan.Wu@analog.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps/physmap.c')
-rw-r--r--drivers/mtd/maps/physmap.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index dfbf3f270ce..876dfab9284 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -251,14 +251,7 @@ static struct platform_driver physmap_flash_driver = {
};
-#ifdef CONFIG_MTD_PHYSMAP_LEN
-#if CONFIG_MTD_PHYSMAP_LEN != 0
-#warning using PHYSMAP compat code
-#define PHYSMAP_COMPAT
-#endif
-#endif
-
-#ifdef PHYSMAP_COMPAT
+#ifdef CONFIG_MTD_PHYSMAP_COMPAT
static struct physmap_flash_data physmap_flash_data = {
.width = CONFIG_MTD_PHYSMAP_BANKWIDTH,
};
@@ -302,7 +295,7 @@ static int __init physmap_init(void)
int err;
err = platform_driver_register(&physmap_flash_driver);
-#ifdef PHYSMAP_COMPAT
+#ifdef CONFIG_MTD_PHYSMAP_COMPAT
if (err == 0)
platform_device_register(&physmap_flash);
#endif
@@ -312,7 +305,7 @@ static int __init physmap_init(void)
static void __exit physmap_exit(void)
{
-#ifdef PHYSMAP_COMPAT
+#ifdef CONFIG_MTD_PHYSMAP_COMPAT
platform_device_unregister(&physmap_flash);
#endif
platform_driver_unregister(&physmap_flash_driver);
@@ -326,8 +319,7 @@ MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
MODULE_DESCRIPTION("Generic configurable MTD map driver");
/* legacy platform drivers can't hotplug or coldplg */
-#ifndef PHYSMAP_COMPAT
+#ifndef CONFIG_MTD_PHYSMAP_COMPAT
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:physmap-flash");
#endif
-