aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-12-01 17:23:40 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-12-10 11:10:05 -0500
commitdcb3e137ce9be1dfc86e306182b23e3ae5e239c4 (patch)
tree1cc0081df2565d12f47334f18941a67a32807fbb
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>
-rw-r--r--drivers/mtd/maps/Kconfig17
-rw-r--r--drivers/mtd/maps/physmap.c16
2 files changed, 18 insertions, 15 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 5ea169362164..3788a548336c 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -23,9 +23,20 @@ config MTD_PHYSMAP
23 To compile this driver as a module, choose M here: the 23 To compile this driver as a module, choose M here: the
24 module will be called physmap. 24 module will be called physmap.
25 25
26config MTD_PHYSMAP_COMPAT
27 bool "Physmap compat support"
28 depends on MTD_PHYSMAP
29 default n
30 help
31 Setup a simple mapping via the Kconfig options. Normally the
32 physmap configuration options are done via your board's
33 resource file.
34
35 If unsure, say N here.
36
26config MTD_PHYSMAP_START 37config MTD_PHYSMAP_START
27 hex "Physical start address of flash mapping" 38 hex "Physical start address of flash mapping"
28 depends on MTD_PHYSMAP 39 depends on MTD_PHYSMAP_COMPAT
29 default "0x8000000" 40 default "0x8000000"
30 help 41 help
31 This is the physical memory location at which the flash chips 42 This is the physical memory location at which the flash chips
@@ -37,7 +48,7 @@ config MTD_PHYSMAP_START
37 48
38config MTD_PHYSMAP_LEN 49config MTD_PHYSMAP_LEN
39 hex "Physical length of flash mapping" 50 hex "Physical length of flash mapping"
40 depends on MTD_PHYSMAP 51 depends on MTD_PHYSMAP_COMPAT
41 default "0" 52 default "0"
42 help 53 help
43 This is the total length of the mapping of the flash chips on 54 This is the total length of the mapping of the flash chips on
@@ -51,7 +62,7 @@ config MTD_PHYSMAP_LEN
51 62
52config MTD_PHYSMAP_BANKWIDTH 63config MTD_PHYSMAP_BANKWIDTH
53 int "Bank width in octets" 64 int "Bank width in octets"
54 depends on MTD_PHYSMAP 65 depends on MTD_PHYSMAP_COMPAT
55 default "2" 66 default "2"
56 help 67 help
57 This is the total width of the data bus of the flash devices 68 This is the total width of the data bus of the flash devices
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index dfbf3f270cea..876dfab92847 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -251,14 +251,7 @@ static struct platform_driver physmap_flash_driver = {
251}; 251};
252 252
253 253
254#ifdef CONFIG_MTD_PHYSMAP_LEN 254#ifdef CONFIG_MTD_PHYSMAP_COMPAT
255#if CONFIG_MTD_PHYSMAP_LEN != 0
256#warning using PHYSMAP compat code
257#define PHYSMAP_COMPAT
258#endif
259#endif
260
261#ifdef PHYSMAP_COMPAT
262static struct physmap_flash_data physmap_flash_data = { 255static struct physmap_flash_data physmap_flash_data = {
263 .width = CONFIG_MTD_PHYSMAP_BANKWIDTH, 256 .width = CONFIG_MTD_PHYSMAP_BANKWIDTH,
264}; 257};
@@ -302,7 +295,7 @@ static int __init physmap_init(void)
302 int err; 295 int err;
303 296
304 err = platform_driver_register(&physmap_flash_driver); 297 err = platform_driver_register(&physmap_flash_driver);
305#ifdef PHYSMAP_COMPAT 298#ifdef CONFIG_MTD_PHYSMAP_COMPAT
306 if (err == 0) 299 if (err == 0)
307 platform_device_register(&physmap_flash); 300 platform_device_register(&physmap_flash);
308#endif 301#endif
@@ -312,7 +305,7 @@ static int __init physmap_init(void)
312 305
313static void __exit physmap_exit(void) 306static void __exit physmap_exit(void)
314{ 307{
315#ifdef PHYSMAP_COMPAT 308#ifdef CONFIG_MTD_PHYSMAP_COMPAT
316 platform_device_unregister(&physmap_flash); 309 platform_device_unregister(&physmap_flash);
317#endif 310#endif
318 platform_driver_unregister(&physmap_flash_driver); 311 platform_driver_unregister(&physmap_flash_driver);
@@ -326,8 +319,7 @@ MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
326MODULE_DESCRIPTION("Generic configurable MTD map driver"); 319MODULE_DESCRIPTION("Generic configurable MTD map driver");
327 320
328/* legacy platform drivers can't hotplug or coldplg */ 321/* legacy platform drivers can't hotplug or coldplg */
329#ifndef PHYSMAP_COMPAT 322#ifndef CONFIG_MTD_PHYSMAP_COMPAT
330/* work with hotplug and coldplug */ 323/* work with hotplug and coldplug */
331MODULE_ALIAS("platform:physmap-flash"); 324MODULE_ALIAS("platform:physmap-flash");
332#endif 325#endif
333