[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1360164629.3398.2.camel@phoenix>
Date: Wed, 06 Feb 2013 23:30:29 +0800
From: Axel Lin <axel.lin@...ics.com>
To: Samuel Ortiz <sameo@...ux.intel.com>
Cc: MyungJoo Ham <myungjoo.ham@...sung.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] mfd: max8997: Return proper error if pdata is NULL
Return proper error instead of 0 if pdata is NULL.
Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
drivers/mfd/max8997.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 1471405..823f34b 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -209,8 +209,10 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
}
}
- if (!pdata)
+ if (!pdata) {
+ ret = -EINVAL;
goto err;
+ }
max8997->pdata = pdata;
max8997->ono = pdata->ono;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists