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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:09 +0000 (09:50 +0200)
commit174fe383de80004e27a339f01b2f47ad58d19335
treeacb35357a1b283bc3d56bf9ff64211393f202f76
parentca28e6a013b2e1765926a63ea5e8e1e8abb22b72
mtd: rawnand: qcom: Return actual error code instead of -ENODEV

[ Upstream commit 55fbb9ba4f06cb6aff32daca1e1910173c13ec51 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/nand/raw/qcom_nandc.c