diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 12:11:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-07 12:11:16 -0500 |
commit | e0d65113a70f1dc514e625cc4e7a7485a4bf72df (patch) | |
tree | 7320a130dc304623f5cf4b5dd8f67fb1776225ca /drivers/mtd/nand/davinci_nand.c | |
parent | cf5e15fbd72c13977720aa15b7b7e00e1d8fd8f2 (diff) | |
parent | 48e546b7f281f251893baa40769581fd15f085fb (diff) |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (226 commits)
mtd: tests: annotate as DANGEROUS in Kconfig
mtd: tests: don't use mtd0 as a default
mtd: clean up usage of MTD_DOCPROBE_ADDRESS
jffs2: add compr=lzo and compr=zlib options
jffs2: implement mount option parsing and compression overriding
mtd: nand: initialize ops.mode
mtd: provide an alias for the redboot module name
mtd: m25p80: don't probe device which has status of 'disabled'
mtd: nand_h1900 never worked
mtd: Add DiskOnChip G3 support
mtd: m25p80: add EON flash EN25Q32B into spi flash id table
mtd: mark block device queue as non-rotational
mtd: r852: make r852_pm_ops static
mtd: m25p80: add support for at25df321a spi data flash
mtd: mxc_nand: preset_v1_v2: unlock all NAND flash blocks
mtd: nand: switch `check_pattern()' to standard `memcmp()'
mtd: nand: invalidate cache on unaligned reads
mtd: nand: do not scan bad blocks with NAND_BBT_NO_OOB set
mtd: nand: wait to set BBT version
mtd: nand: scrub BBT on ECC errors
...
Fix up trivial conflicts:
- arch/arm/mach-at91/board-usb-a9260.c
Merged into board-usb-a926x.c
- drivers/mtd/maps/lantiq-flash.c
add_mtd_partitions -> mtd_device_register vs changed to use
mtd_device_parse_register.
Diffstat (limited to 'drivers/mtd/nand/davinci_nand.c')
-rw-r--r-- | drivers/mtd/nand/davinci_nand.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 1f34951ae1a7..c153e1f77f90 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c | |||
@@ -57,7 +57,6 @@ struct davinci_nand_info { | |||
57 | 57 | ||
58 | struct device *dev; | 58 | struct device *dev; |
59 | struct clk *clk; | 59 | struct clk *clk; |
60 | bool partitioned; | ||
61 | 60 | ||
62 | bool is_readmode; | 61 | bool is_readmode; |
63 | 62 | ||
@@ -530,8 +529,6 @@ static int __init nand_davinci_probe(struct platform_device *pdev) | |||
530 | int ret; | 529 | int ret; |
531 | uint32_t val; | 530 | uint32_t val; |
532 | nand_ecc_modes_t ecc_mode; | 531 | nand_ecc_modes_t ecc_mode; |
533 | struct mtd_partition *mtd_parts = NULL; | ||
534 | int mtd_parts_nb = 0; | ||
535 | 532 | ||
536 | /* insist on board-specific configuration */ | 533 | /* insist on board-specific configuration */ |
537 | if (!pdata) | 534 | if (!pdata) |
@@ -581,7 +578,9 @@ static int __init nand_davinci_probe(struct platform_device *pdev) | |||
581 | info->chip.chip_delay = 0; | 578 | info->chip.chip_delay = 0; |
582 | info->chip.select_chip = nand_davinci_select_chip; | 579 | info->chip.select_chip = nand_davinci_select_chip; |
583 | 580 | ||
584 | /* options such as NAND_USE_FLASH_BBT or 16-bit widths */ | 581 | /* options such as NAND_BBT_USE_FLASH */ |
582 | info->chip.bbt_options = pdata->bbt_options; | ||
583 | /* options such as 16-bit widths */ | ||
585 | info->chip.options = pdata->options; | 584 | info->chip.options = pdata->options; |
586 | info->chip.bbt_td = pdata->bbt_td; | 585 | info->chip.bbt_td = pdata->bbt_td; |
587 | info->chip.bbt_md = pdata->bbt_md; | 586 | info->chip.bbt_md = pdata->bbt_md; |
@@ -751,33 +750,8 @@ syndrome_done: | |||
751 | if (ret < 0) | 750 | if (ret < 0) |
752 | goto err_scan; | 751 | goto err_scan; |
753 | 752 | ||
754 | if (mtd_has_cmdlinepart()) { | 753 | ret = mtd_device_parse_register(&info->mtd, NULL, 0, |
755 | static const char *probes[] __initconst = { | 754 | pdata->parts, pdata->nr_parts); |
756 | "cmdlinepart", NULL | ||
757 | }; | ||
758 | |||
759 | mtd_parts_nb = parse_mtd_partitions(&info->mtd, probes, | ||
760 | &mtd_parts, 0); | ||
761 | } | ||
762 | |||
763 | if (mtd_parts_nb <= 0) { | ||
764 | mtd_parts = pdata->parts; | ||
765 | mtd_parts_nb = pdata->nr_parts; | ||
766 | } | ||
767 | |||
768 | /* Register any partitions */ | ||
769 | if (mtd_parts_nb > 0) { | ||
770 | ret = mtd_device_register(&info->mtd, mtd_parts, | ||
771 | mtd_parts_nb); | ||
772 | if (ret == 0) | ||
773 | info->partitioned = true; | ||
774 | } | ||
775 | |||
776 | /* If there's no partition info, just package the whole chip | ||
777 | * as a single MTD device. | ||
778 | */ | ||
779 | if (!info->partitioned) | ||
780 | ret = mtd_device_register(&info->mtd, NULL, 0) ? -ENODEV : 0; | ||
781 | 755 | ||
782 | if (ret < 0) | 756 | if (ret < 0) |
783 | goto err_scan; | 757 | goto err_scan; |
@@ -816,9 +790,6 @@ err_nomem: | |||
816 | static int __exit nand_davinci_remove(struct platform_device *pdev) | 790 | static int __exit nand_davinci_remove(struct platform_device *pdev) |
817 | { | 791 | { |
818 | struct davinci_nand_info *info = platform_get_drvdata(pdev); | 792 | struct davinci_nand_info *info = platform_get_drvdata(pdev); |
819 | int status; | ||
820 | |||
821 | status = mtd_device_unregister(&info->mtd); | ||
822 | 793 | ||
823 | spin_lock_irq(&davinci_nand_lock); | 794 | spin_lock_irq(&davinci_nand_lock); |
824 | if (info->chip.ecc.mode == NAND_ECC_HW_SYNDROME) | 795 | if (info->chip.ecc.mode == NAND_ECC_HW_SYNDROME) |