mtd: rawnand: qcom: Return actual error code instead of -ENODEV
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tue, 2 Mar 2021 13:27:57 +0000 (18:57 +0530)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 11 Mar 2021 08:37:30 +0000 (09:37 +0100)
commit55fbb9ba4f06cb6aff32daca1e1910173c13ec51
treef8842d2418cc31dda7a5beaf20470d66b4606182
parent08608adb520e51403be7592c2214846fa440a23a
mtd: rawnand: qcom: Return actual error code instead of -ENODEV

In qcom_probe_nand_devices() function, the error code returned by
qcom_nand_host_init_and_register() is converted to -ENODEV in the case
of failure. This poses issue if -EPROBE_DEFER is returned when the
dependency is not available for a component like parser.

So let's restructure the error handling logic a bit and return the
actual error code in case of qcom_nand_host_init_and_register() failure.

Fixes: c76b78d8ec05 ("mtd: nand: Qualcomm NAND controller driver")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/qcom_nandc.c