Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207775
b: refs/heads/master
c: 68640c2
h: refs/heads/master
i:
  207773: cc8c8d0
  207771: bbadc8a
  207767: 6d7b8c5
  207759: 657388a
  207743: 2d510f4
v: v3
  • Loading branch information
Richard Cochran authored and David Woodhouse committed Aug 4, 2010
1 parent 3d91507 commit 580e551
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04dd0d3a9a33fdd8c3516db0fa85d9dba5610fc2
refs/heads/master: 68640c2a416849ba8e0a69577d4be51a458a045a
35 changes: 27 additions & 8 deletions trunk/drivers/mtd/maps/ixp4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
*dest++ = BYTE1(data);
src += 2;
len -= 2;
}
}

if (len > 0)
*dest++ = BYTE0(flash_read16(src));
Expand Down Expand Up @@ -185,6 +185,8 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
{
struct flash_platform_data *plat = dev->dev.platform_data;
struct ixp4xx_flash_info *info;
const char *part_type = NULL;
int nr_parts = 0;
int err = -1;

if (!plat)
Expand Down Expand Up @@ -218,9 +220,9 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
*/
info->map.bankwidth = 2;
info->map.name = dev_name(&dev->dev);
info->map.read = ixp4xx_read16,
info->map.write = ixp4xx_probe_write16,
info->map.copy_from = ixp4xx_copy_from,
info->map.read = ixp4xx_read16;
info->map.write = ixp4xx_probe_write16;
info->map.copy_from = ixp4xx_copy_from;

info->res = request_mem_region(dev->resource->start,
resource_size(dev->resource),
Expand Down Expand Up @@ -248,11 +250,28 @@ static int ixp4xx_flash_probe(struct platform_device *dev)
info->mtd->owner = THIS_MODULE;

/* Use the fast version */
info->map.write = ixp4xx_write16,
info->map.write = ixp4xx_write16;

#ifdef CONFIG_MTD_PARTITIONS
nr_parts = parse_mtd_partitions(info->mtd, probes, &info->partitions,
dev->resource->start);
#endif
if (nr_parts > 0) {
part_type = "dynamic";
} else {
info->partitions = plat->parts;
nr_parts = plat->nr_parts;
part_type = "static";
}
if (nr_parts == 0) {
printk(KERN_NOTICE "IXP4xx flash: no partition info "
"available, registering whole flash\n");
err = add_mtd_device(info->mtd);
} else {
printk(KERN_NOTICE "IXP4xx flash: using %s partition "
"definition\n", part_type);
err = add_mtd_partitions(info->mtd, info->partitions, nr_parts);

err = parse_mtd_partitions(info->mtd, probes, &info->partitions, dev->resource->start);
if (err > 0) {
err = add_mtd_partitions(info->mtd, info->partitions, err);
if(err)
printk(KERN_ERR "Could not parse partitions\n");
}
Expand Down

0 comments on commit 580e551

Please sign in to comment.