Skip to contentSkip to conversation

dma: imx-sdma: Let the driver be probed even if no firware is found

PATCH In review Fabio Estevam 3 participants 4 messages Feb 29, 2012 – Mar 6, 2012

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 dma: imx-sdma: Let the driver be probed even if no firware is found

On the device tree case the code bails out when the firmware name cannot be found or if the firmware fails to be requested.

Fix this behaviour as the SDMA engine can still operate with the built-in ROM scripts.

---
 drivers/dma/imx-sdma.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
drivers/dma/imx-sdma.c +5 -8
index bf736ad..130b994 100644
@@ -1397,15 +1397,12 @@ static int __init sdma_probe(struct platform_device *pdev)
 		 */
 		ret = of_property_read_string(np, "fsl,sdma-ram-script-name",
 					      &fw_name);
-		if (ret) {
+		if (ret)
 			dev_err(&pdev->dev, "failed to get firmware name\n");
-			goto err_init;
-		}
-
-		ret = sdma_get_firmware(sdma, fw_name);
-		if (ret) {
-			dev_err(&pdev->dev, "failed to get firmware\n");
-			goto err_init;
+		else {
+			ret = sdma_get_firmware(sdma, fw_name);
+			if (ret)
+				dev_err(&pdev->dev, "failed to get firmware\n");
 		}
 	}
 
Signature · 1 line
1.7.1
author reviewer
#1 lore raw

PATCH 2/2 dma: imx-sdma: Print a message when firmare fails to be requested

Print a message when firmare fails to be requested in the case of platform data being used.

While at it, distinguish between the error messages of the device tree and platform data cases.

---
 drivers/dma/imx-sdma.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/dma/imx-sdma.c +4 -2
index 130b994..f0bfc0e 100644
@@ -1388,7 +1388,9 @@ static int __init sdma_probe(struct platform_device *pdev)
 		sdma_add_scripts(sdma, pdata->script_addrs);
 
 	if (pdata) {
-		sdma_get_firmware(sdma, pdata->fw_name);
+		ret = sdma_get_firmware(sdma, pdata->fw_name);
+		if (ret)
+			dev_err(&pdev->dev, "failed to get firmware from platform data\n");
 	} else {
 		/*
 		 * Because that device tree does not encode ROM script address,
@@ -1402,7 +1404,7 @@ static int __init sdma_probe(struct platform_device *pdev)
 		else {
 			ret = sdma_get_firmware(sdma, fw_name);
 			if (ret)
-				dev_err(&pdev->dev, "failed to get firmware\n");
+				dev_err(&pdev->dev, "failed to get firmware from device tree\n");
 		}
 	}
 
Signature · 1 line
1.7.1
maintainer Acked-by on v1 1/2
#2 lore raw
In reply to Fabio Estevam
Quoted 7 lines · Fabio Estevam

On the device tree case the code bails out when the firmware name cannot be found or if the firmware fails to be requested.

Fix this behaviour as the SDMA engine can still operate with the built-in ROM scripts.

Both patches:

Quoted 33 lines
---
 drivers/dma/imx-sdma.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
drivers/dma/imx-sdma.c +5 -8
index bf736ad..130b994 100644
@@ -1397,15 +1397,12 @@ static int __init sdma_probe(struct platform_device *pdev)
 		 */
 		ret = of_property_read_string(np, "fsl,sdma-ram-script-name",
 					      &fw_name);
-		if (ret) {
+		if (ret)
 			dev_err(&pdev->dev, "failed to get firmware name\n");
-			goto err_init;
-		}
-
-		ret = sdma_get_firmware(sdma, fw_name);
-		if (ret) {
-			dev_err(&pdev->dev, "failed to get firmware\n");
-			goto err_init;
+		else {
+			ret = sdma_get_firmware(sdma, fw_name);
+			if (ret)
+				dev_err(&pdev->dev, "failed to get firmware\n");
 		}
 	}
 
Signature · 1 line
1.7.1
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw
In reply to Fabio Estevam
Quoted 7 lines · Fabio Estevam

On the device tree case the code bails out when the firmware name cannot be found or if the firmware fails to be requested.

Fix this behaviour as the SDMA engine can still operate with the built-in ROM scripts.

Both Applied, Thanks

Quoted 29 lines
---
 drivers/dma/imx-sdma.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
drivers/dma/imx-sdma.c +5 -8
index bf736ad..130b994 100644
@@ -1397,15 +1397,12 @@ static int __init sdma_probe(struct platform_device *pdev)
 		 */
 		ret = of_property_read_string(np, "fsl,sdma-ram-script-name",
 					      &fw_name);
-		if (ret) {
+		if (ret)
 			dev_err(&pdev->dev, "failed to get firmware name\n");
-			goto err_init;
-		}
-
-		ret = sdma_get_firmware(sdma, fw_name);
-		if (ret) {
-			dev_err(&pdev->dev, "failed to get firmware\n");
-			goto err_init;
+		else {
+			ret = sdma_get_firmware(sdma, fw_name);
+			if (ret)
+				dev_err(&pdev->dev, "failed to get firmware\n");
 		}
 	}
 
Signature · 1 line
~Vinod