[MTD] Deal correctly with NOR chips which are smaller than the map window
authorDavid Woodhouse <dwmw2@infradead.org>
Sun, 14 May 2006 00:40:50 +0000 (01:40 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Sun, 14 May 2006 00:40:50 +0000 (01:40 +0100)
commit0f5ae3d2e9f49af55eb2a9b7cb54b4c0c2373017
treec06f26d34bff12e4324e901a6406835894010da3
parenta6550e57f9d074511cf420bdb802ab5e56edc3bb
[MTD] Deal correctly with NOR chips which are smaller than the map window

We used to calculate the number of chips to be zero, allocate an array
of that size, then nasty things would happen when we attempt to access
the first object in that zero-sized array.

Now, if the number of _full_ chips that would fit into the map is zero,
we allocate an array of one anyway, and then artificially reduce the
total size of the resulting MTD device to fit in the map.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/chips/gen_probe.c