Skip to content

Commit d45b526

Browse files
valpackettgregkh
authored andcommitted
mtd: rawnand: rockchip: ensure NVDDR timings are rejected
commit b27d894 upstream. .setup_interface first gets called with a "target" value of NAND_DATA_IFACE_CHECK_ONLY, in which case an error is expected if the controller driver does not support the timing mode (NVDDR). Fixes: a9ecc8c ("mtd: rawnand: Choose the best timings, NV-DDR included") Signed-off-by: Val Packett <val@packett.cool> Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240519031409.26464-1-val@packett.cool Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 375ab23 commit d45b526

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/mtd/nand/raw/rockchip-nand-controller.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,13 @@ static int rk_nfc_setup_interface(struct nand_chip *chip, int target,
420420
u32 rate, tc2rw, trwpw, trw2c;
421421
u32 temp;
422422

423-
if (target < 0)
424-
return 0;
425-
426423
timings = nand_get_sdr_timings(conf);
427424
if (IS_ERR(timings))
428425
return -EOPNOTSUPP;
429426

427+
if (target < 0)
428+
return 0;
429+
430430
if (IS_ERR(nfc->nfc_clk))
431431
rate = clk_get_rate(nfc->ahb_clk);
432432
else

0 commit comments

Comments
 (0)