aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/pmc551.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/devices/pmc551.c')
-rw-r--r--drivers/mtd/devices/pmc551.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index 933127ecebe5..d394e06e4279 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -116,16 +116,6 @@ static int pmc551_erase(struct mtd_info *mtd, struct erase_info *instr)
116#endif 116#endif
117 117
118 end = instr->addr + instr->len - 1; 118 end = instr->addr + instr->len - 1;
119
120 /* Is it past the end? */
121 if (end > mtd->size) {
122#ifdef CONFIG_MTD_PMC551_DEBUG
123 printk(KERN_DEBUG "pmc551_erase() out of bounds (%ld > %ld)\n",
124 (long)end, (long)mtd->size);
125#endif
126 return -EINVAL;
127 }
128
129 eoff_hi = end & ~(priv->asize - 1); 119 eoff_hi = end & ~(priv->asize - 1);
130 soff_hi = instr->addr & ~(priv->asize - 1); 120 soff_hi = instr->addr & ~(priv->asize - 1);
131 eoff_lo = end & (priv->asize - 1); 121 eoff_lo = end & (priv->asize - 1);
@@ -179,14 +169,6 @@ static int pmc551_point(struct mtd_info *mtd, loff_t from, size_t len,
179 printk(KERN_DEBUG "pmc551_point(%ld, %ld)\n", (long)from, (long)len); 169 printk(KERN_DEBUG "pmc551_point(%ld, %ld)\n", (long)from, (long)len);
180#endif 170#endif
181 171
182 if (from + len > mtd->size) {
183#ifdef CONFIG_MTD_PMC551_DEBUG
184 printk(KERN_DEBUG "pmc551_point() out of bounds (%ld > %ld)\n",
185 (long)from + len, (long)mtd->size);
186#endif
187 return -EINVAL;
188 }
189
190 /* can we return a physical address with this driver? */ 172 /* can we return a physical address with this driver? */
191 if (phys) 173 if (phys)
192 return -EINVAL; 174 return -EINVAL;
@@ -230,16 +212,6 @@ static int pmc551_read(struct mtd_info *mtd, loff_t from, size_t len,
230#endif 212#endif
231 213
232 end = from + len - 1; 214 end = from + len - 1;
233
234 /* Is it past the end? */
235 if (end > mtd->size) {
236#ifdef CONFIG_MTD_PMC551_DEBUG
237 printk(KERN_DEBUG "pmc551_read() out of bounds (%ld > %ld)\n",
238 (long)end, (long)mtd->size);
239#endif
240 return -EINVAL;
241 }
242
243 soff_hi = from & ~(priv->asize - 1); 215 soff_hi = from & ~(priv->asize - 1);
244 eoff_hi = end & ~(priv->asize - 1); 216 eoff_hi = end & ~(priv->asize - 1);
245 soff_lo = from & (priv->asize - 1); 217 soff_lo = from & (priv->asize - 1);
@@ -297,16 +269,6 @@ static int pmc551_write(struct mtd_info *mtd, loff_t to, size_t len,
297#endif 269#endif
298 270
299 end = to + len - 1; 271 end = to + len - 1;
300 /* Is it past the end? or did the u32 wrap? */
301 if (end > mtd->size) {
302#ifdef CONFIG_MTD_PMC551_DEBUG
303 printk(KERN_DEBUG "pmc551_write() out of bounds (end: %ld, "
304 "size: %ld, to: %ld)\n", (long)end, (long)mtd->size,
305 (long)to);
306#endif
307 return -EINVAL;
308 }
309
310 soff_hi = to & ~(priv->asize - 1); 272 soff_hi = to & ~(priv->asize - 1);
311 eoff_hi = end & ~(priv->asize - 1); 273 eoff_hi = end & ~(priv->asize - 1);
312 soff_lo = to & (priv->asize - 1); 274 soff_lo = to & (priv->asize - 1);