Skip to contentSkip to conversation

gen_probe.c: Probe chips in decreasing device size (most significant first)

PATCH In review Michel Stempin 2 participants 2 messages Sep 14, 2008 – Oct 8, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gen_probe.c: Probe chips in decreasing device size (most significant first)

Probe chips in decreasing device size to detect most significant chip IDs first in case there are two chips with the same LSB.

This case has been found between SST39VF3201 (Mfr: 0x0020, Id: 0x235B) and SST49LF080A (Mfr: 0x0020, Id: 0x005B) chips.

---
 gen_probe.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/mtd/chips/gen_probe.c
index f061885..d1875f8 100644

drivers/mtd/chips/gen_probe.c +0 -0
@@ -170,7 +170,7 @@ static int genprobe_new_chip(struct map_info *map,

struct chip_probe *cp,

 {
        int min_chips = (map_bankwidth(map)/4?:1); /* At most 4-bytes

wide. */
int max_chips = map_bankwidth(map); /* And minimum 1 */
- int nr_chips, type;
+ int nr_chips, min_type, type;

for (nr_chips = max_chips; nr_chips >= min_chips; nr_chips >>=
1) {

@@ -181,9 +181,9 @@ static int genprobe_new_chip(struct map_info *map, struct chip_probe *cp,

                /* Minimum device size. Don't look for one 8-bit device
                   in a 16-bit bus, etc. */

- type = map_bankwidth(map) / nr_chips;
+ min_type = map_bankwidth(map) / nr_chips;

- for (; type <= CFI_DEVICETYPE_X32; type<<=1) {
+ for (type = CFI_DEVICETYPE_X32; type >= min_type;

type>>=1) {
                        cfi->device_type = type;
 
                        if (cp->probe_chip(map, 0, NULL, cfi))
#1 lore raw
Quoted 7 lines · Michel Stempin

Probe chips in decreasing device size to detect most significant chip IDs first in case there are two chips with the same LSB.

This case has been found between SST39VF3201 (Mfr: 0x0020, Id: 0x235B) and SST49LF080A (Mfr: 0x0020, Id: 0x005B) chips.

Your patch is word-wrapped.

josh