Skip to contentSkip to conversation

ASoC: fsl_asrc: Propagate the real error code

PATCH In review Fabio Estevam 2 participants 5 messages Aug 19, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ASoC: fsl_asrc: Propagate the real error code

Instead of returning -EINVAL on error, return the real error code.

---
 sound/soc/fsl/fsl_asrc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/fsl/fsl_asrc.c +3 -3
index c1a0e01..15f8ba5 100644
@@ -892,7 +892,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 	ret = fsl_asrc_init(asrc_priv);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to init asrc %d\n", ret);
-		return -EINVAL;
+		return ret;
 	}
 
 	asrc_priv->channel_avail = 10;
@@ -901,14 +901,14 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 				   &asrc_priv->asrc_rate);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to get output rate\n");
-		return -EINVAL;
+		return ret;
 	}
 
 	ret = of_property_read_u32(np, "fsl,asrc-width",
 				   &asrc_priv->asrc_width);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to get output width\n");
-		return -EINVAL;
+		return ret;
 	}
 
 	if (asrc_priv->asrc_width != 16 && asrc_priv->asrc_width != 24) {
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 ASoC: fsl_asrc: Use np variable

The 'np' variable is already assigned to 'pdev->dev.of_node', so use it to improve readability.

No functional change.

---
 sound/soc/fsl/fsl_asrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/fsl/fsl_asrc.c +1 -1
index 15f8ba5..a37339a 100644
@@ -879,7 +879,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 		}
 	}
 
-	if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx35-asrc")) {
+	if (of_device_is_compatible(np, "fsl,imx35-asrc")) {
 		asrc_priv->channel_bits = 3;
 		clk_map[IN] = input_clk_map_imx35;
 		clk_map[OUT] = output_clk_map_imx35;
Signature · 1 line
1.9.1
maintainer
#2 lore raw

Re: [PATCH 2/3] ASoC: fsl_asrc: Use np variable

Quoted 2 lines · Fabio Estevam

The 'np' variable is already assigned to 'pdev->dev.of_node', so use it to improve readability.

Oh, now this turned up - must've been caught up in a queue somewhere.

#3 lore raw

PATCH 3/3 ASoC: fsl_asrc: Remove unneeded driver registration message

In reply to Fabio Estevam

There is no need to announce that the driver has been successfully probed, so remove the unneeded message.

---
 sound/soc/fsl/fsl_asrc.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/fsl/fsl_asrc.c +0 -2
index a37339a..b7157ce 100644
@@ -933,8 +933,6 @@ static int fsl_asrc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	dev_info(&pdev->dev, "driver registered\n");
-
 	return 0;
 }
 
Signature · 1 line
1.9.1
maintainer
#4 lore raw
In reply to Fabio Estevam
Quoted 1 line · Fabio Estevam

Instead of returning -EINVAL on error, return the real error code.

I seem to be missing patch 2/3 for some reason?