Skip to contentSkip to conversation

drm/imx: check the value returned by regulator_set_voltage()

PATCH Applied Fabio Estevam 2 participants 4 messages Jul 9, 2016 – Jul 11, 2016

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/3 drm/imx: check the value returned by regulator_set_voltage()

From: Fabio Estevam <[email protected]>

regulator_set_voltage() may fail, so we better check its return value and propagate it in the case of error.

---
 drivers/gpu/drm/imx/imx-tve.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/imx/imx-tve.c +3 -1
index baf7881..c93301c 100644
@@ -633,7 +633,9 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data)
 
 	tve->dac_reg = devm_regulator_get(dev, "dac");
 	if (!IS_ERR(tve->dac_reg)) {
-		regulator_set_voltage(tve->dac_reg, 2750000, 2750000);
+		ret = regulator_set_voltage(tve->dac_reg, 2750000, 2750000);
+		if (ret)
+			return ret;
 		ret = regulator_enable(tve->dac_reg);
 		if (ret)
 			return ret;
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author reviewer
#1 lore raw

PATCH 2/3 drm/imx: fix the error message

From: Fabio Estevam <[email protected]>

The error message should say "hsync" instead of "vsync" as we have just checked the "fsl,hsync-pin" property.

---
 drivers/gpu/drm/imx/imx-tve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/imx/imx-tve.c +1 -1
index c93301c..a52939c 100644
@@ -590,7 +590,7 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data)
 					   &tve->hsync_pin);
 
 		if (ret < 0) {
-			dev_err(dev, "failed to get vsync pin\n");
+			dev_err(dev, "failed to get hsync pin\n");
 			return ret;
 		}
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author reviewer
#2 lore raw

PATCH 3/3 drm/imx: remove unneeded 'or' operation

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need for doing an extra 'or' operation when reading the return value from of_property_read_u32().

Just do a simple read instead.

---
 drivers/gpu/drm/imx/imx-tve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/imx/imx-tve.c +1 -1
index a52939c..2cf0631 100644
@@ -594,7 +594,7 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data)
 			return ret;
 		}
 
-		ret |= of_property_read_u32(np, "fsl,vsync-pin",
+		ret = of_property_read_u32(np, "fsl,vsync-pin",
 					    &tve->vsync_pin);
 
 		if (ret < 0) {
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
In reply to Fabio Estevam

Am Samstag, den 09.07.2016, 18:57 -0300 schrieb Fabio Estevam:

Quoted 6 lines

From: Fabio Estevam <[email protected]>

regulator_set_voltage() may fail, so we better check its return value and propagate it in the case of error.

Applied all three, thank you.

regards
Philipp

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel