diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-02-03 11:13:23 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:29:11 -0400 |
commit | 664addc248d2fed68d013d26ff2fc796d7134259 (patch) | |
tree | 197681f173c14068a8d634c9ab1c889fd02316cf /drivers/mtd/chips | |
parent | 5def48982b778aaebe201f85af7170b7d0a6619f (diff) |
mtd: remove R/O checking duplication
Many drivers check whether the partition is R/O and return -EROFS if yes.
Let's stop having duplicated checks and move them to the API functions
instead.
And again a bit of noise - deleted few too sparse newlines, sorry.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/map_ram.c | 4 | ||||
-rw-r--r-- | drivers/mtd/chips/map_rom.c | 3 |
2 files changed, 1 insertions, 6 deletions
diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c index 225307088dc0..991c2a1c05d3 100644 --- a/drivers/mtd/chips/map_ram.c +++ b/drivers/mtd/chips/map_ram.c | |||
@@ -122,14 +122,10 @@ static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr) | |||
122 | unsigned long i; | 122 | unsigned long i; |
123 | 123 | ||
124 | allff = map_word_ff(map); | 124 | allff = map_word_ff(map); |
125 | |||
126 | for (i=0; i<instr->len; i += map_bankwidth(map)) | 125 | for (i=0; i<instr->len; i += map_bankwidth(map)) |
127 | map_write(map, allff, instr->addr + i); | 126 | map_write(map, allff, instr->addr + i); |
128 | |||
129 | instr->state = MTD_ERASE_DONE; | 127 | instr->state = MTD_ERASE_DONE; |
130 | |||
131 | mtd_erase_callback(instr); | 128 | mtd_erase_callback(instr); |
132 | |||
133 | return 0; | 129 | return 0; |
134 | } | 130 | } |
135 | 131 | ||
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c index facb56092d39..47a43cf7e5c6 100644 --- a/drivers/mtd/chips/map_rom.c +++ b/drivers/mtd/chips/map_rom.c | |||
@@ -85,8 +85,7 @@ static void maprom_nop(struct mtd_info *mtd) | |||
85 | 85 | ||
86 | static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) | 86 | static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) |
87 | { | 87 | { |
88 | printk(KERN_NOTICE "maprom_write called\n"); | 88 | return -EROFS; |
89 | return -EIO; | ||
90 | } | 89 | } |
91 | 90 | ||
92 | static int maprom_erase (struct mtd_info *mtd, struct erase_info *info) | 91 | static int maprom_erase (struct mtd_info *mtd, struct erase_info *info) |