]> Git Repo - J-linux.git/commitdiff
mtd: rawnand: rockchip: ensure NVDDR timings are rejected
authorVal Packett <[email protected]>
Sun, 19 May 2024 03:13:39 +0000 (00:13 -0300)
committerMiquel Raynal <[email protected]>
Mon, 27 May 2024 11:42:25 +0000 (13:42 +0200)
.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: a9ecc8c814e9 ("mtd: rawnand: Choose the best timings, NV-DDR included")
Signed-off-by: Val Packett <[email protected]>
Cc: [email protected]
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
drivers/mtd/nand/raw/rockchip-nand-controller.c

index 7baaef69d70ad426c4989981a13d8c1b5d0cdf9b..55580447633be0704e4ab88aacdb5b4f34e90f25 100644 (file)
@@ -420,13 +420,13 @@ static int rk_nfc_setup_interface(struct nand_chip *chip, int target,
        u32 rate, tc2rw, trwpw, trw2c;
        u32 temp;
 
-       if (target < 0)
-               return 0;
-
        timings = nand_get_sdr_timings(conf);
        if (IS_ERR(timings))
                return -EOPNOTSUPP;
 
+       if (target < 0)
+               return 0;
+
        if (IS_ERR(nfc->nfc_clk))
                rate = clk_get_rate(nfc->ahb_clk);
        else
This page took 0.052883 seconds and 4 git commands to generate.