MLK-23822: soc: imx: secvio: Fix boot message when nvmem not initialised
When the nvmem subsystem is not initialised at boot, the probe will fail and an error message will be displayed. In this case the message should not be printed as the driver will be probed later. This patch checks the error code from nvmem before printing the message. It also fixes the cleaning path as the driver was not exiting properly. Signed-off-by: Franck LENORMAND <franck.lenormand@nxp.com> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
7b8a2d17a1
commit
2e2d8dc156
|
@ -494,8 +494,12 @@ static int imx_secvio_sc_setup(struct device *dev)
|
|||
|
||||
data->nvmem = devm_nvmem_device_get(dev, NULL);
|
||||
if (IS_ERR(data->nvmem)) {
|
||||
dev_err(dev, "Failed to retrieve nvmem\n");
|
||||
return PTR_ERR(data->nvmem);
|
||||
ret = PTR_ERR(data->nvmem);
|
||||
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(dev, "Failed to retrieve nvmem\n");
|
||||
|
||||
goto clean;
|
||||
}
|
||||
|
||||
/* Get a handle */
|
||||
|
@ -644,7 +648,7 @@ static int imx_secvio_sc_probe(struct platform_device *pdev)
|
|||
struct device *dev = &pdev->dev;
|
||||
|
||||
ret = imx_secvio_sc_setup(dev);
|
||||
if (ret)
|
||||
if (ret && ret != -EPROBE_DEFER)
|
||||
dev_err(dev, "Failed to setup\n");
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue