aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Dessenne <fabien.dessenne@st.com>2019-04-24 09:25:44 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-04-30 13:48:14 -0400
commitb5b5a27bee5884860798ffd0f08e611a3942064b (patch)
treec4c50fe3669119fb017dc4b0294d25ab793dfbb2
parent7afa8db323e37b9174cf78a1c9ab0ae7a9f5e7dd (diff)
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>
-rw-r--r--drivers/media/platform/stm32/stm32-dcmi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index 906e71b19039..b9dad0accd1b 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -1672,7 +1672,7 @@ static int dcmi_probe(struct platform_device *pdev)
1672 dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); 1672 dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
1673 if (IS_ERR(dcmi->rstc)) { 1673 if (IS_ERR(dcmi->rstc)) {
1674 dev_err(&pdev->dev, "Could not get reset control\n"); 1674 dev_err(&pdev->dev, "Could not get reset control\n");
1675 return -ENODEV; 1675 return PTR_ERR(dcmi->rstc);
1676 } 1676 }
1677 1677
1678 /* Get bus characteristics from devicetree */ 1678 /* Get bus characteristics from devicetree */
@@ -1687,7 +1687,7 @@ static int dcmi_probe(struct platform_device *pdev)
1687 of_node_put(np); 1687 of_node_put(np);
1688 if (ret) { 1688 if (ret) {
1689 dev_err(&pdev->dev, "Could not parse the endpoint\n"); 1689 dev_err(&pdev->dev, "Could not parse the endpoint\n");
1690 return -ENODEV; 1690 return ret;
1691 } 1691 }
1692 1692
1693 if (ep.bus_type == V4L2_MBUS_CSI2_DPHY) { 1693 if (ep.bus_type == V4L2_MBUS_CSI2_DPHY) {
@@ -1700,8 +1700,9 @@ static int dcmi_probe(struct platform_device *pdev)
1700 1700
1701 irq = platform_get_irq(pdev, 0); 1701 irq = platform_get_irq(pdev, 0);
1702 if (irq <= 0) { 1702 if (irq <= 0) {
1703 dev_err(&pdev->dev, "Could not get irq\n"); 1703 if (irq != -EPROBE_DEFER)
1704 return -ENODEV; 1704 dev_err(&pdev->dev, "Could not get irq\n");
1705 return irq;
1705 } 1706 }
1706 1707
1707 dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1708 dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1721,12 +1722,13 @@ static int dcmi_probe(struct platform_device *pdev)
1721 dev_name(&pdev->dev), dcmi); 1722 dev_name(&pdev->dev), dcmi);
1722 if (ret) { 1723 if (ret) {
1723 dev_err(&pdev->dev, "Unable to request irq %d\n", irq); 1724 dev_err(&pdev->dev, "Unable to request irq %d\n", irq);
1724 return -ENODEV; 1725 return ret;
1725 } 1726 }
1726 1727
1727 mclk = devm_clk_get(&pdev->dev, "mclk"); 1728 mclk = devm_clk_get(&pdev->dev, "mclk");
1728 if (IS_ERR(mclk)) { 1729 if (IS_ERR(mclk)) {
1729 dev_err(&pdev->dev, "Unable to get mclk\n"); 1730 if (PTR_ERR(mclk) != -EPROBE_DEFER)
1731 dev_err(&pdev->dev, "Unable to get mclk\n");
1730 return PTR_ERR(mclk); 1732 return PTR_ERR(mclk);
1731 } 1733 }
1732 1734