Skip to contentSkip to conversation

irda/sa1100_ir: check return value of startup hook

PATCH Applied Dmitry Artamonow 3 participants 4 messages Oct 9, 2009 – Oct 13, 2009

Subsystems (2)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irda/sa1100_ir: check return value of startup hook

---
 drivers/net/irda/sa1100_ir.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/net/irda/sa1100_ir.c +5 -2
index 38bf7cf..df5db2d 100644
@@ -232,8 +232,11 @@ static int sa1100_irda_startup(struct sa1100_irda *si)
 	/*
 	 * Ensure that the ports for this device are setup correctly.
 	 */
-	if (si->pdata->startup)
-		si->pdata->startup(si->dev);
+	if (si->pdata->startup)	{
+		ret = si->pdata->startup(si->dev);
+		if (ret)
+			return ret;
+		}
 
 	/*
 	 * Configure PPC for IRDA - we want to drive TXD2 low.
Signature · 1 line
1.6.3.4
#1 lore raw

Hello.

Quoted 1 line · Dmitry Artamonow

[...]

Quoted 5 lines
drivers/net/irda/sa1100_ir.c +0 -0
index 38bf7cf..df5db2d 100644

drivers/net/irda/sa1100_ir.c static int sa1100_irda_startup(struct sa1100_irda *si) · line 239

Quoted 10 lines
drivers/net/irda/sa1100_ir.c +5 -2
@@ -232,8 +232,11 @@ static int sa1100_irda_startup(struct sa1100_irda *si)
 	/*
 	 * Ensure that the ports for this device are setup correctly.
 	 */
-	if (si->pdata->startup)
-		si->pdata->startup(si->dev);
+	if (si->pdata->startup)	{
+		ret = si->pdata->startup(si->dev);
+		if (ret)
+			return ret;
+		}

Overindented brace.

drivers/net/irda/sa1100_ir.c static int sa1100_irda_startup(struct sa1100_irda *si) · line 242

Quoted 3 lines
drivers/net/irda/sa1100_ir.c +0 -0
 	/*
 	 * Configure PPC for IRDA - we want to drive TXD2 low.

WBR, Sergei

#2 lore raw

On 16:14 Fri 09 Oct , Sergei Shtylyov wrote:

[...]

Quoted 10 lines

Review

Quoted 7 lines
(quoted diff) +5 -2
-	if (si->pdata->startup)
-		si->pdata->startup(si->dev);
+	if (si->pdata->startup)	{
+		ret = si->pdata->startup(si->dev);
+		if (ret)
+			return ret;
+		}

Overindented brace.

Nice catch, thanks!

Updated patch in attachment.

Signature · 2 lines
Best regards,
Dmitry "MAD" Artamonow