diff options
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/doc2000.c | 1 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2001.c | 1 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2001plus.c | 1 | ||||
-rw-r--r-- | drivers/mtd/devices/docecc.c | 1 | ||||
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 19 | ||||
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 18 | ||||
-rw-r--r-- | drivers/mtd/devices/mtdram.c | 14 |
7 files changed, 30 insertions, 25 deletions
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c index 50de839c77a9..5bf5f460e132 100644 --- a/drivers/mtd/devices/doc2000.c +++ b/drivers/mtd/devices/doc2000.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <asm/errno.h> | 10 | #include <asm/errno.h> |
11 | #include <asm/io.h> | 11 | #include <asm/io.h> |
12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
13 | #include <linux/miscdevice.h> | ||
14 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
15 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
16 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c index e32c568c1145..0990f7803628 100644 --- a/drivers/mtd/devices/doc2001.c +++ b/drivers/mtd/devices/doc2001.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <asm/errno.h> | 10 | #include <asm/errno.h> |
11 | #include <asm/io.h> | 11 | #include <asm/io.h> |
12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
13 | #include <linux/miscdevice.h> | ||
14 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
15 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
16 | #include <linux/init.h> | 15 | #include <linux/init.h> |
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c index d853f891b586..719b2915dc3a 100644 --- a/drivers/mtd/devices/doc2001plus.c +++ b/drivers/mtd/devices/doc2001plus.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <asm/errno.h> | 14 | #include <asm/errno.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
17 | #include <linux/miscdevice.h> | ||
18 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
19 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
20 | #include <linux/init.h> | 19 | #include <linux/init.h> |
diff --git a/drivers/mtd/devices/docecc.c b/drivers/mtd/devices/docecc.c index 874e51b110a2..a19cda52da5c 100644 --- a/drivers/mtd/devices/docecc.c +++ b/drivers/mtd/devices/docecc.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <asm/errno.h> | 26 | #include <asm/errno.h> |
27 | #include <asm/io.h> | 27 | #include <asm/io.h> |
28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
29 | #include <linux/miscdevice.h> | ||
30 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
31 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
32 | #include <linux/init.h> | 31 | #include <linux/init.h> |
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 7c3fc766dcf1..8185b1f3e5e6 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -65,12 +65,6 @@ | |||
65 | #define FAST_READ_DUMMY_BYTE 0 | 65 | #define FAST_READ_DUMMY_BYTE 0 |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #ifdef CONFIG_MTD_PARTITIONS | ||
69 | #define mtd_has_partitions() (1) | ||
70 | #else | ||
71 | #define mtd_has_partitions() (0) | ||
72 | #endif | ||
73 | |||
74 | /****************************************************************************/ | 68 | /****************************************************************************/ |
75 | 69 | ||
76 | struct m25p { | 70 | struct m25p { |
@@ -678,6 +672,8 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
678 | flash->mtd.erasesize = info->sector_size; | 672 | flash->mtd.erasesize = info->sector_size; |
679 | } | 673 | } |
680 | 674 | ||
675 | flash->mtd.dev.parent = &spi->dev; | ||
676 | |||
681 | dev_info(&spi->dev, "%s (%lld Kbytes)\n", info->name, | 677 | dev_info(&spi->dev, "%s (%lld Kbytes)\n", info->name, |
682 | (long long)flash->mtd.size >> 10); | 678 | (long long)flash->mtd.size >> 10); |
683 | 679 | ||
@@ -708,12 +704,13 @@ static int __devinit m25p_probe(struct spi_device *spi) | |||
708 | struct mtd_partition *parts = NULL; | 704 | struct mtd_partition *parts = NULL; |
709 | int nr_parts = 0; | 705 | int nr_parts = 0; |
710 | 706 | ||
711 | #ifdef CONFIG_MTD_CMDLINE_PARTS | 707 | if (mtd_has_cmdlinepart()) { |
712 | static const char *part_probes[] = { "cmdlinepart", NULL, }; | 708 | static const char *part_probes[] |
709 | = { "cmdlinepart", NULL, }; | ||
713 | 710 | ||
714 | nr_parts = parse_mtd_partitions(&flash->mtd, | 711 | nr_parts = parse_mtd_partitions(&flash->mtd, |
715 | part_probes, &parts, 0); | 712 | part_probes, &parts, 0); |
716 | #endif | 713 | } |
717 | 714 | ||
718 | if (nr_parts <= 0 && data && data->parts) { | 715 | if (nr_parts <= 0 && data && data->parts) { |
719 | parts = data->parts; | 716 | parts = data->parts; |
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 6d9f810565c8..62dee54af0a5 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -98,12 +98,6 @@ struct dataflash { | |||
98 | struct mtd_info mtd; | 98 | struct mtd_info mtd; |
99 | }; | 99 | }; |
100 | 100 | ||
101 | #ifdef CONFIG_MTD_PARTITIONS | ||
102 | #define mtd_has_partitions() (1) | ||
103 | #else | ||
104 | #define mtd_has_partitions() (0) | ||
105 | #endif | ||
106 | |||
107 | /* ......................................................................... */ | 101 | /* ......................................................................... */ |
108 | 102 | ||
109 | /* | 103 | /* |
@@ -670,6 +664,8 @@ add_dataflash_otp(struct spi_device *spi, char *name, | |||
670 | device->write = dataflash_write; | 664 | device->write = dataflash_write; |
671 | device->priv = priv; | 665 | device->priv = priv; |
672 | 666 | ||
667 | device->dev.parent = &spi->dev; | ||
668 | |||
673 | if (revision >= 'c') | 669 | if (revision >= 'c') |
674 | otp_tag = otp_setup(device, revision); | 670 | otp_tag = otp_setup(device, revision); |
675 | 671 | ||
@@ -682,11 +678,13 @@ add_dataflash_otp(struct spi_device *spi, char *name, | |||
682 | struct mtd_partition *parts; | 678 | struct mtd_partition *parts; |
683 | int nr_parts = 0; | 679 | int nr_parts = 0; |
684 | 680 | ||
685 | #ifdef CONFIG_MTD_CMDLINE_PARTS | 681 | if (mtd_has_cmdlinepart()) { |
686 | static const char *part_probes[] = { "cmdlinepart", NULL, }; | 682 | static const char *part_probes[] |
683 | = { "cmdlinepart", NULL, }; | ||
687 | 684 | ||
688 | nr_parts = parse_mtd_partitions(device, part_probes, &parts, 0); | 685 | nr_parts = parse_mtd_partitions(device, |
689 | #endif | 686 | part_probes, &parts, 0); |
687 | } | ||
690 | 688 | ||
691 | if (nr_parts <= 0 && pdata && pdata->parts) { | 689 | if (nr_parts <= 0 && pdata && pdata->parts) { |
692 | parts = pdata->parts; | 690 | parts = pdata->parts; |
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index 3aaca88847d3..fce5ff7589aa 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c | |||
@@ -65,6 +65,19 @@ static void ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) | |||
65 | { | 65 | { |
66 | } | 66 | } |
67 | 67 | ||
68 | /* | ||
69 | * Allow NOMMU mmap() to directly map the device (if not NULL) | ||
70 | * - return the address to which the offset maps | ||
71 | * - return -ENOSYS to indicate refusal to do the mapping | ||
72 | */ | ||
73 | static unsigned long ram_get_unmapped_area(struct mtd_info *mtd, | ||
74 | unsigned long len, | ||
75 | unsigned long offset, | ||
76 | unsigned long flags) | ||
77 | { | ||
78 | return (unsigned long) mtd->priv + offset; | ||
79 | } | ||
80 | |||
68 | static int ram_read(struct mtd_info *mtd, loff_t from, size_t len, | 81 | static int ram_read(struct mtd_info *mtd, loff_t from, size_t len, |
69 | size_t *retlen, u_char *buf) | 82 | size_t *retlen, u_char *buf) |
70 | { | 83 | { |
@@ -116,6 +129,7 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, | |||
116 | mtd->erase = ram_erase; | 129 | mtd->erase = ram_erase; |
117 | mtd->point = ram_point; | 130 | mtd->point = ram_point; |
118 | mtd->unpoint = ram_unpoint; | 131 | mtd->unpoint = ram_unpoint; |
132 | mtd->get_unmapped_area = ram_get_unmapped_area; | ||
119 | mtd->read = ram_read; | 133 | mtd->read = ram_read; |
120 | mtd->write = ram_write; | 134 | mtd->write = ram_write; |
121 | 135 | ||