Commit b2b5921
mtd: rawnand: initialize ntargets with maxchips
memorg->ntargets is initialized with '1'. It should be initialized with
the maxchips argument from nand_scan() instead. Otherwise multi chip
support errors out on the secondary chip selects when trying to call
nand_reset() on them:
WARNING: CPU: 0 PID: 1 at drivers/mtd/nand/raw/internals.h:114
nand_reset_op+0x194/0x1c4
With this memorg->ntargets is initialized with the maximum number of
chip selects supported by the driver. After having detected the number
of actually connected chips memory->ntargets is updated with that
number.
Fixes: 32813e2 ("mtd: rawnand: Get rid of chip->numchips")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>1 parent a188339 commit b2b5921
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4666 | 4666 | | |
4667 | 4667 | | |
4668 | 4668 | | |
4669 | | - | |
4670 | 4669 | | |
4671 | 4670 | | |
4672 | 4671 | | |
| |||
5031 | 5030 | | |
5032 | 5031 | | |
5033 | 5032 | | |
| 5033 | + | |
| 5034 | + | |
5034 | 5035 | | |
5035 | 5036 | | |
5036 | 5037 | | |
| |||
0 commit comments