1
0
Fork 0

media: stm32-dcmi: return appropriate error codes during probe

During probe, return the provided errors value instead of -ENODEV.
This allows the driver to be deferred probed if needed.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
hifive-unleashed-5.2
Fabien Dessenne 2019-04-24 09:25:44 -04:00 committed by Mauro Carvalho Chehab
parent 7afa8db323
commit b5b5a27bee
1 changed files with 8 additions and 6 deletions

View File

@ -1672,7 +1672,7 @@ static int dcmi_probe(struct platform_device *pdev)
dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
if (IS_ERR(dcmi->rstc)) { if (IS_ERR(dcmi->rstc)) {
dev_err(&pdev->dev, "Could not get reset control\n"); dev_err(&pdev->dev, "Could not get reset control\n");
return -ENODEV; return PTR_ERR(dcmi->rstc);
} }
/* Get bus characteristics from devicetree */ /* Get bus characteristics from devicetree */
@ -1687,7 +1687,7 @@ static int dcmi_probe(struct platform_device *pdev)
of_node_put(np); of_node_put(np);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Could not parse the endpoint\n"); dev_err(&pdev->dev, "Could not parse the endpoint\n");
return -ENODEV; return ret;
} }
if (ep.bus_type == V4L2_MBUS_CSI2_DPHY) { if (ep.bus_type == V4L2_MBUS_CSI2_DPHY) {
@ -1700,8 +1700,9 @@ static int dcmi_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
if (irq != -EPROBE_DEFER)
dev_err(&pdev->dev, "Could not get irq\n"); dev_err(&pdev->dev, "Could not get irq\n");
return -ENODEV; return irq;
} }
dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@ -1721,11 +1722,12 @@ static int dcmi_probe(struct platform_device *pdev)
dev_name(&pdev->dev), dcmi); dev_name(&pdev->dev), dcmi);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Unable to request irq %d\n", irq); dev_err(&pdev->dev, "Unable to request irq %d\n", irq);
return -ENODEV; return ret;
} }
mclk = devm_clk_get(&pdev->dev, "mclk"); mclk = devm_clk_get(&pdev->dev, "mclk");
if (IS_ERR(mclk)) { if (IS_ERR(mclk)) {
if (PTR_ERR(mclk) != -EPROBE_DEFER)
dev_err(&pdev->dev, "Unable to get mclk\n"); dev_err(&pdev->dev, "Unable to get mclk\n");
return PTR_ERR(mclk); return PTR_ERR(mclk);
} }