]> git.baikalelectronics.ru Git - uboot.git/commit
spi: nxp_fspi: Fix error reporting
authorAdam Ford <aford173@gmail.com>
Mon, 18 Jan 2021 21:32:49 +0000 (15:32 -0600)
committerJagan Teki <jagan@amarulasolutions.com>
Fri, 26 Feb 2021 09:39:38 +0000 (15:09 +0530)
commit63ab2289467702bfa6f2f51ba3a95b621354d50d
tree8e913c8296dd93e7573edb6ffd1661dc5001e127
parenta50b66cbabf670c4bcfcf2f077499dbab54f47a9
spi: nxp_fspi: Fix error reporting

On the i.MX8M Mini, ret = clk_set_rate() sets ret to the value of the
rate the clock was able to set.  When checking for errors, it only
checks that it is not NULL.  Since positive numbers are not errors,
only check for negative numbers when handling errors.

Fixes: b2b3c5e98cae ("spi: nxp_fspi: new driver for the FlexSPI controller")
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/spi/nxp_fspi.c