All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/2] mx53loco: Remove unneeded 'retval' variable
@ 2012-12-28 14:05 Fabio Estevam
  2012-12-28 14:05 ` [U-Boot] [PATCH v2 2/2] mx53loco: Improve error handling on power_init() Fabio Estevam
  2013-01-05 17:11 ` [U-Boot] [PATCH v2 1/2] mx53loco: Remove unneeded 'retval' variable Stefano Babic
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2012-12-28 14:05 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@freescale.com>

commit c73368150 (pmic: Extend PMIC framework to support multiple instances 
of PMIC devices) introduced an extra 'retval' variable, but this is not 
necessary since we have already the variable 'ret' in place.

So use 'ret' to store the return values from the pmic related calls and remove
'retval'.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1: 
- No changes
 board/freescale/mx53loco/mx53loco.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index 63a4f8b..b1bfb90 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -345,12 +345,11 @@ static int power_init(void)
 	unsigned int val;
 	int ret = -1;
 	struct pmic *p;
-	int retval;
 
 	if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR)) {
-		retval = pmic_dialog_init(I2C_PMIC);
-		if (retval)
-			return retval;
+		ret = pmic_dialog_init(I2C_PMIC);
+		if (ret)
+			return ret;
 
 		p = pmic_get("DIALOG_PMIC");
 		if (!p)
@@ -370,9 +369,9 @@ static int power_init(void)
 	}
 
 	if (!i2c_probe(CONFIG_SYS_FSL_PMIC_I2C_ADDR)) {
-		retval = pmic_init(I2C_PMIC);
-		if (retval)
-			return retval;
+		ret = pmic_init(I2C_PMIC);
+		if (ret)
+			return ret;
 
 		p = pmic_get("FSL_PMIC");
 		if (!p)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-05 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-28 14:05 [U-Boot] [PATCH v2 1/2] mx53loco: Remove unneeded 'retval' variable Fabio Estevam
2012-12-28 14:05 ` [U-Boot] [PATCH v2 2/2] mx53loco: Improve error handling on power_init() Fabio Estevam
2013-01-05 17:10   ` Stefano Babic
2013-01-05 17:11 ` [U-Boot] [PATCH v2 1/2] mx53loco: Remove unneeded 'retval' variable Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.