[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>
This commit is contained in:
Mike Frysinger 2008-12-01 14:23:40 -08:00 коммит произвёл David Woodhouse
Родитель c4956ed6fa
Коммит dcb3e137ce
2 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -23,9 +23,20 @@ config MTD_PHYSMAP
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called physmap. module will be called physmap.
config MTD_PHYSMAP_COMPAT
bool "Physmap compat support"
depends on MTD_PHYSMAP
default n
help
Setup a simple mapping via the Kconfig options. Normally the
physmap configuration options are done via your board's
resource file.
If unsure, say N here.
config MTD_PHYSMAP_START config MTD_PHYSMAP_START
hex "Physical start address of flash mapping" hex "Physical start address of flash mapping"
depends on MTD_PHYSMAP depends on MTD_PHYSMAP_COMPAT
default "0x8000000" default "0x8000000"
help help
This is the physical memory location at which the flash chips This is the physical memory location at which the flash chips
@ -37,7 +48,7 @@ config MTD_PHYSMAP_START
config MTD_PHYSMAP_LEN config MTD_PHYSMAP_LEN
hex "Physical length of flash mapping" hex "Physical length of flash mapping"
depends on MTD_PHYSMAP depends on MTD_PHYSMAP_COMPAT
default "0" default "0"
help help
This is the total length of the mapping of the flash chips on This is the total length of the mapping of the flash chips on
@ -51,7 +62,7 @@ config MTD_PHYSMAP_LEN
config MTD_PHYSMAP_BANKWIDTH config MTD_PHYSMAP_BANKWIDTH
int "Bank width in octets" int "Bank width in octets"
depends on MTD_PHYSMAP depends on MTD_PHYSMAP_COMPAT
default "2" default "2"
help help
This is the total width of the data bus of the flash devices This is the total width of the data bus of the flash devices

Просмотреть файл

@ -251,14 +251,7 @@ static struct platform_driver physmap_flash_driver = {
}; };
#ifdef CONFIG_MTD_PHYSMAP_LEN #ifdef CONFIG_MTD_PHYSMAP_COMPAT
#if CONFIG_MTD_PHYSMAP_LEN != 0
#warning using PHYSMAP compat code
#define PHYSMAP_COMPAT
#endif
#endif
#ifdef PHYSMAP_COMPAT
static struct physmap_flash_data physmap_flash_data = { static struct physmap_flash_data physmap_flash_data = {
.width = CONFIG_MTD_PHYSMAP_BANKWIDTH, .width = CONFIG_MTD_PHYSMAP_BANKWIDTH,
}; };
@ -302,7 +295,7 @@ static int __init physmap_init(void)
int err; int err;
err = platform_driver_register(&physmap_flash_driver); err = platform_driver_register(&physmap_flash_driver);
#ifdef PHYSMAP_COMPAT #ifdef CONFIG_MTD_PHYSMAP_COMPAT
if (err == 0) if (err == 0)
platform_device_register(&physmap_flash); platform_device_register(&physmap_flash);
#endif #endif
@ -312,7 +305,7 @@ static int __init physmap_init(void)
static void __exit physmap_exit(void) static void __exit physmap_exit(void)
{ {
#ifdef PHYSMAP_COMPAT #ifdef CONFIG_MTD_PHYSMAP_COMPAT
platform_device_unregister(&physmap_flash); platform_device_unregister(&physmap_flash);
#endif #endif
platform_driver_unregister(&physmap_flash_driver); platform_driver_unregister(&physmap_flash_driver);
@ -326,8 +319,7 @@ MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
MODULE_DESCRIPTION("Generic configurable MTD map driver"); MODULE_DESCRIPTION("Generic configurable MTD map driver");
/* legacy platform drivers can't hotplug or coldplg */ /* legacy platform drivers can't hotplug or coldplg */
#ifndef PHYSMAP_COMPAT #ifndef CONFIG_MTD_PHYSMAP_COMPAT
/* work with hotplug and coldplug */ /* work with hotplug and coldplug */
MODULE_ALIAS("platform:physmap-flash"); MODULE_ALIAS("platform:physmap-flash");
#endif #endif