Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27771
b: refs/heads/master
c: 0f5ae3d
h: refs/heads/master
i:
  27769: 6e22c06
  27767: 31c4e50
v: v3
  • Loading branch information
David Woodhouse committed May 14, 2006
1 parent 690223b commit ed7ea5f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: a6550e57f9d074511cf420bdb802ab5e56edc3bb
refs/heads/master: 0f5ae3d2e9f49af55eb2a9b7cb54b4c0c2373017
16 changes: 14 additions & 2 deletions trunk/drivers/mtd/chips/gen_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe *cp)
if (!mtd)
mtd = check_cmd_set(map, 0); /* Then the secondary */

if (mtd)
if (mtd) {
if (mtd->size > map->size) {
printk(KERN_WARNING "Reducing visibility of %lKiB chip to %lKiB\n",
(unsigned long)mtd->size >> 10,
(unsigned long)map->size >> 10);
mtd->size = map->size;
}
return mtd;
}

printk(KERN_WARNING"gen_probe: No supported Vendor Command Set found\n");

Expand Down Expand Up @@ -100,7 +107,12 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi
* Align bitmap storage size to full byte.
*/
max_chips = map->size >> cfi.chipshift;
mapsize = (max_chips / 8) + ((max_chips % 8) ? 1 : 0);
if (!max_chips) {
printk(KERN_WARNING "NOR chip too large to fit in mapping. Attempting to cope...\n");
max_chips = 1;
}

mapsize = (max_chips + BITS_PER_LONG-1) / BITS_PER_LONG;
chip_map = kmalloc(mapsize, GFP_KERNEL);
if (!chip_map) {
printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name);
Expand Down

0 comments on commit ed7ea5f

Please sign in to comment.