diff mbox

irda/sa1100_ir: check return value of startup hook

Message ID 20091009201224.GA6208@rainbow
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Dmitry Artamonow Oct. 9, 2009, 8:12 p.m. UTC
On 16:14 Fri 09 Oct     , Sergei Shtylyov wrote:

[...]
> > -	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.

Comments

David Miller Oct. 13, 2009, 10:17 a.m. UTC | #1
From: Dmitry Artamonow <mad_soft@inbox.ru>
Date: Sat, 10 Oct 2009 00:12:24 +0400

>>From ba1fe701950634aae46aa59431633e99f8bd18cc Mon Sep 17 00:00:00 2001
> From: Dmitry Artamonow <mad_soft@inbox.ru>
> Date: Fri, 9 Oct 2009 21:56:21 +0400
> Subject: [PATCH v2] irda/sa1100_ir: check return value of startup hook
> 
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c
index 38bf7cf..c412e80 100644
--- a/drivers/net/irda/sa1100_ir.c
+++ b/drivers/net/irda/sa1100_ir.c
@@ -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.