Skip to content

Commit

Permalink
Merge git://git.infradead.org/mtd-2.6
Browse files Browse the repository at this point in the history
* git://git.infradead.org/mtd-2.6: (97 commits)
  mtd: kill CONFIG_MTD_PARTITIONS
  mtd: remove add_mtd_partitions, add_mtd_device and friends
  mtd: convert remaining users to mtd_device_register()
  mtd: samsung onenand: convert to mtd_device_register()
  mtd: omap2 onenand: convert to mtd_device_register()
  mtd: txx9ndfmc: convert to mtd_device_register()
  mtd: tmio_nand: convert to mtd_device_register()
  mtd: socrates_nand: convert to mtd_device_register()
  mtd: sharpsl: convert to mtd_device_register()
  mtd: s3c2410 nand: convert to mtd_device_register()
  mtd: ppchameleonevb: convert to mtd_device_register()
  mtd: orion_nand: convert to mtd_device_register()
  mtd: omap2: convert to mtd_device_register()
  mtd: nomadik_nand: convert to mtd_device_register()
  mtd: ndfc: convert to mtd_device_register()
  mtd: mxc_nand: convert to mtd_device_register()
  mtd: mpc5121_nfc: convert to mtd_device_register()
  mtd: jz4740_nand: convert to mtd_device_register()
  mtd: h1910: convert to mtd_device_register()
  mtd: fsmc_nand: convert to mtd_device_register()
  ...

Fixed up trivial conflicts in
 - drivers/mtd/maps/integrator-flash.c: removed in ARM tree
 - drivers/mtd/maps/physmap.c: addition of afs partition probe type
   clashing with removal of CONFIG_MTD_PARTITIONS
  • Loading branch information
torvalds committed May 28, 2011
2 parents 4260483 + 6a8a98b commit 29a6ccc
Show file tree
Hide file tree
Showing 152 changed files with 1,041 additions and 1,690 deletions.
3 changes: 1 addition & 2 deletions Documentation/DocBook/mtdnand.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ static void __iomem *baseaddr;
<title>Partition defines</title>
<para>
If you want to divide your device into partitions, then
enable the configuration switch CONFIG_MTD_PARTITIONS and define
a partitioning scheme suitable to your board.
define a partitioning scheme suitable to your board.
</para>
<programlisting>
#define NUM_PARTITIONS 2
Expand Down
7 changes: 1 addition & 6 deletions arch/arm/mach-gemini/board-wbd111.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ static struct sys_timer wbd111_timer = {
.init = gemini_timer_init,
};

#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition wbd111_partitions[] = {
{
.name = "RedBoot",
Expand Down Expand Up @@ -116,11 +115,7 @@ static struct mtd_partition wbd111_partitions[] = {
.mask_flags = MTD_WRITEABLE,
}
};
#define wbd111_num_partitions ARRAY_SIZE(wbd111_partitions)
#else
#define wbd111_partitions NULL
#define wbd111_num_partitions 0
#endif /* CONFIG_MTD_PARTITIONS */
#define wbd111_num_partitions ARRAY_SIZE(wbd111_partitions)

static void __init wbd111_init(void)
{
Expand Down
7 changes: 1 addition & 6 deletions arch/arm/mach-gemini/board-wbd222.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ static struct sys_timer wbd222_timer = {
.init = gemini_timer_init,
};

#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition wbd222_partitions[] = {
{
.name = "RedBoot",
Expand Down Expand Up @@ -116,11 +115,7 @@ static struct mtd_partition wbd222_partitions[] = {
.mask_flags = MTD_WRITEABLE,
}
};
#define wbd222_num_partitions ARRAY_SIZE(wbd222_partitions)
#else
#define wbd222_partitions NULL
#define wbd222_num_partitions 0
#endif /* CONFIG_MTD_PARTITIONS */
#define wbd222_num_partitions ARRAY_SIZE(wbd222_partitions)

static void __init wbd222_init(void)
{
Expand Down
4 changes: 0 additions & 4 deletions arch/arm/mach-ixp4xx/ixdp425-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ static struct platform_device ixdp425_flash = {
#if defined(CONFIG_MTD_NAND_PLATFORM) || \
defined(CONFIG_MTD_NAND_PLATFORM_MODULE)

#ifdef CONFIG_MTD_PARTITIONS
const char *part_probes[] = { "cmdlinepart", NULL };

static struct mtd_partition ixdp425_partitions[] = {
Expand All @@ -74,7 +73,6 @@ static struct mtd_partition ixdp425_partitions[] = {
.size = MTDPART_SIZ_FULL
},
};
#endif

static void
ixdp425_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
Expand Down Expand Up @@ -103,11 +101,9 @@ static struct platform_nand_data ixdp425_flash_nand_data = {
.nr_chips = 1,
.chip_delay = 30,
.options = NAND_NO_AUTOINCR,
#ifdef CONFIG_MTD_PARTITIONS
.part_probe_types = part_probes,
.partitions = ixdp425_partitions,
.nr_partitions = ARRAY_SIZE(ixdp425_partitions),
#endif
},
.ctrl = {
.cmd_ctrl = ixdp425_flash_nand_cmd_ctrl
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-pxa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ config MACH_XCEP
bool "Iskratel Electronics XCEP"
select PXA25x
select MTD
select MTD_PARTITIONS
select MTD_PHYSMAP
select MTD_CFI_INTELEXT
select MTD_CFI
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-s3c2410/mach-amlm5900.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
#include <plat/cpu.h>
#include <plat/gpio-cfg.h>

#ifdef CONFIG_MTD_PARTITIONS

#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/map.h>
Expand Down Expand Up @@ -113,7 +111,6 @@ static struct platform_device amlm5900_device_nor = {
.num_resources = 1,
.resource = &amlm5900_nor_resource,
};
#endif

static struct map_desc amlm5900_iodesc[] __initdata = {
};
Expand Down Expand Up @@ -158,9 +155,7 @@ static struct platform_device *amlm5900_devices[] __initdata = {
&s3c_device_rtc,
&s3c_device_usbgadget,
&s3c_device_sdi,
#ifdef CONFIG_MTD_PARTITIONS
&amlm5900_device_nor,
#endif
};

static void __init amlm5900_map_io(void)
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-s3c2410/mach-tct_hammer.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#include <plat/devs.h>
#include <plat/cpu.h>

#ifdef CONFIG_MTD_PARTITIONS

#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/map.h>
Expand Down Expand Up @@ -91,8 +89,6 @@ static struct platform_device tct_hammer_device_nor = {
.resource = &tct_hammer_nor_resource,
};

#endif

static struct map_desc tct_hammer_iodesc[] __initdata = {
};

Expand Down Expand Up @@ -133,9 +129,7 @@ static struct platform_device *tct_hammer_devices[] __initdata = {
&s3c_device_rtc,
&s3c_device_usbgadget,
&s3c_device_sdi,
#ifdef CONFIG_MTD_PARTITIONS
&tct_hammer_device_nor,
#endif
};

static void __init tct_hammer_map_io(void)
Expand Down
4 changes: 0 additions & 4 deletions arch/blackfin/mach-bf537/boards/stamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ static struct platform_device net2272_bfin_device = {
#endif

#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
#ifdef CONFIG_MTD_PARTITIONS
const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };

static struct mtd_partition bfin_plat_nand_partitions[] = {
Expand All @@ -396,7 +395,6 @@ static struct mtd_partition bfin_plat_nand_partitions[] = {
.offset = MTDPART_OFS_APPEND,
},
};
#endif

#define BFIN_NAND_PLAT_CLE 2
#define BFIN_NAND_PLAT_ALE 1
Expand All @@ -423,11 +421,9 @@ static struct platform_nand_data bfin_plat_nand_data = {
.chip = {
.nr_chips = 1,
.chip_delay = 30,
#ifdef CONFIG_MTD_PARTITIONS
.part_probe_types = part_probes,
.partitions = bfin_plat_nand_partitions,
.nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
#endif
},
.ctrl = {
.cmd_ctrl = bfin_plat_nand_cmd_ctrl,
Expand Down
4 changes: 0 additions & 4 deletions arch/blackfin/mach-bf561/boards/acvilon.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ static struct platform_device bfin_uart0_device = {

#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)

#ifdef CONFIG_MTD_PARTITIONS
const char *part_probes[] = { "cmdlinepart", NULL };

static struct mtd_partition bfin_plat_nand_partitions[] = {
Expand All @@ -257,7 +256,6 @@ static struct mtd_partition bfin_plat_nand_partitions[] = {
.offset = MTDPART_OFS_APPEND,
},
};
#endif

#define BFIN_NAND_PLAT_CLE 2
#define BFIN_NAND_PLAT_ALE 3
Expand Down Expand Up @@ -286,11 +284,9 @@ static struct platform_nand_data bfin_plat_nand_data = {
.chip = {
.nr_chips = 1,
.chip_delay = 30,
#ifdef CONFIG_MTD_PARTITIONS
.part_probe_types = part_probes,
.partitions = bfin_plat_nand_partitions,
.nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
#endif
},
.ctrl = {
.cmd_ctrl = bfin_plat_nand_cmd_ctrl,
Expand Down
1 change: 0 additions & 1 deletion arch/cris/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ config ETRAX_AXISFLASHMAP
select MTD_JEDECPROBE if ETRAX_ARCH_V32
select MTD_CHAR
select MTD_BLOCK
select MTD_PARTITIONS
select MTD_COMPLEX_MAPPINGS
help
This option enables MTD mapping of flash devices. Needed to use
Expand Down
10 changes: 6 additions & 4 deletions arch/cris/arch-v10/drivers/axisflashmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static int __init init_axis_flash(void)
#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
if (mymtd) {
main_partition.size = mymtd->size;
err = add_mtd_partitions(mymtd, &main_partition, 1);
err = mtd_device_register(mymtd, &main_partition, 1);
if (err)
panic("axisflashmap: Could not initialize "
"partition for whole main mtd device!\n");
Expand All @@ -382,10 +382,12 @@ static int __init init_axis_flash(void)
if (mymtd) {
if (use_default_ptable) {
printk(KERN_INFO " Using default partition table.\n");
err = add_mtd_partitions(mymtd, axis_default_partitions,
NUM_DEFAULT_PARTITIONS);
err = mtd_device_register(mymtd,
axis_default_partitions,
NUM_DEFAULT_PARTITIONS);
} else {
err = add_mtd_partitions(mymtd, axis_partitions, pidx);
err = mtd_device_register(mymtd, axis_partitions,
pidx);
}

if (err)
Expand Down
1 change: 0 additions & 1 deletion arch/cris/arch-v32/drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ config ETRAX_AXISFLASHMAP
select MTD_JEDECPROBE
select MTD_CHAR
select MTD_BLOCK
select MTD_PARTITIONS
select MTD_COMPLEX_MAPPINGS
help
This option enables MTD mapping of flash devices. Needed to use
Expand Down
7 changes: 4 additions & 3 deletions arch/cris/arch-v32/drivers/axisflashmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ static int __init init_axis_flash(void)
#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
if (main_mtd) {
main_partition.size = main_mtd->size;
err = add_mtd_partitions(main_mtd, &main_partition, 1);
err = mtd_device_register(main_mtd, &main_partition, 1);
if (err)
panic("axisflashmap: Could not initialize "
"partition for whole main mtd device!\n");
Expand Down Expand Up @@ -597,7 +597,8 @@ static int __init init_axis_flash(void)
mtd_ram->erasesize = (main_mtd ? main_mtd->erasesize :
CONFIG_ETRAX_PTABLE_SECTOR);
} else {
err = add_mtd_partitions(main_mtd, &partition[part], 1);
err = mtd_device_register(main_mtd, &partition[part],
1);
if (err)
panic("axisflashmap: Could not add mtd "
"partition %d\n", part);
Expand Down Expand Up @@ -633,7 +634,7 @@ static int __init init_axis_flash(void)
#ifndef CONFIG_ETRAX_VCS_SIM
if (aux_mtd) {
aux_partition.size = aux_mtd->size;
err = add_mtd_partitions(aux_mtd, &aux_partition, 1);
err = mtd_device_register(aux_mtd, &aux_partition, 1);
if (err)
panic("axisflashmap: Could not initialize "
"aux mtd device!\n");
Expand Down
11 changes: 1 addition & 10 deletions arch/mips/cavium-octeon/flash_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

static struct map_info flash_map;
static struct mtd_info *mymtd;
#ifdef CONFIG_MTD_PARTITIONS
static int nr_parts;
static struct mtd_partition *parts;
static const char *part_probe_types[] = {
Expand All @@ -26,7 +25,6 @@ static const char *part_probe_types[] = {
#endif
NULL
};
#endif

/**
* Module/ driver initialization.
Expand Down Expand Up @@ -63,17 +61,10 @@ static int __init flash_init(void)
if (mymtd) {
mymtd->owner = THIS_MODULE;

#ifdef CONFIG_MTD_PARTITIONS
nr_parts = parse_mtd_partitions(mymtd,
part_probe_types,
&parts, 0);
if (nr_parts > 0)
add_mtd_partitions(mymtd, parts, nr_parts);
else
add_mtd_device(mymtd);
#else
add_mtd_device(mymtd);
#endif
mtd_device_register(mymtd, parts, nr_parts);
} else {
pr_err("Failed to register MTD device for flash\n");
}
Expand Down
3 changes: 1 addition & 2 deletions arch/mips/txx9/generic/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,6 @@ void __init txx9_physmap_flash_init(int no, unsigned long addr,
.flags = IORESOURCE_MEM,
};
struct platform_device *pdev;
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition parts[2];
struct physmap_flash_data pdata_part;

Expand All @@ -658,7 +657,7 @@ void __init txx9_physmap_flash_init(int no, unsigned long addr,
pdata_part.parts = parts;
pdata = &pdata_part;
}
#endif

pdev = platform_device_alloc("physmap-flash", no);
if (!pdev ||
platform_device_add_resources(pdev, &res, 1) ||
Expand Down
18 changes: 1 addition & 17 deletions drivers/mtd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ config MTD_TESTS
should normally be compiled as kernel modules. The modules perform
various checks and verifications when loaded.

config MTD_PARTITIONS
bool "MTD partitioning support"
help
If you have a device which needs to divide its flash chip(s) up
into multiple 'partitions', each of which appears to the user as
a separate MTD device, you require this option to be enabled. If
unsure, say 'Y'.

Note, however, that you don't need this option for the DiskOnChip
devices. Partitioning on NFTL 'devices' is a different - that's the
'normal' form of partitioning used on a block device.

if MTD_PARTITIONS

config MTD_REDBOOT_PARTS
tristate "RedBoot partition table parsing"
---help---
Expand Down Expand Up @@ -99,7 +85,7 @@ endif # MTD_REDBOOT_PARTS

config MTD_CMDLINE_PARTS
bool "Command line partition table parsing"
depends on MTD_PARTITIONS = "y" && MTD = "y"
depends on MTD = "y"
---help---
Allow generic configuration of the MTD partition tables via the kernel
command line. Multiple flash resources are supported for hardware where
Expand Down Expand Up @@ -163,8 +149,6 @@ config MTD_AR7_PARTS
---help---
TI AR7 partitioning support

endif # MTD_PARTITIONS

comment "User Modules And Translation Layers"

config MTD_CHAR
Expand Down
3 changes: 1 addition & 2 deletions drivers/mtd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

# Core functionality.
obj-$(CONFIG_MTD) += mtd.o
mtd-y := mtdcore.o mtdsuper.o mtdconcat.o
mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o
mtd-$(CONFIG_MTD_OF_PARTS) += ofpart.o

obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
Expand Down
10 changes: 3 additions & 7 deletions drivers/mtd/chips/cfi_cmdset_0001.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,9 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
break;

if (time_after(jiffies, timeo)) {
/* Urgh. Resume and pretend we weren't here. */
map_write(map, CMD(0xd0), adr);
/* Make sure we're in 'read status' mode if it had finished */
map_write(map, CMD(0x70), adr);
chip->state = FL_ERASING;
chip->oldstate = FL_READY;
/* Urgh. Resume and pretend we weren't here.
* Make sure we're in 'read status' mode if it had finished */
put_chip(map, chip, adr);
printk(KERN_ERR "%s: Chip not ready after erase "
"suspended: status = 0x%lx\n", map->name, status.x[0]);
return -EIO;
Expand Down Expand Up @@ -997,7 +994,6 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad

switch(chip->oldstate) {
case FL_ERASING:
chip->state = chip->oldstate;
/* What if one interleaved chip has finished and the
other hasn't? The old code would leave the finished
one in READY mode. That's bad, and caused -EROFS
Expand Down
Loading

0 comments on commit 29a6ccc

Please sign in to comment.