Skip to contentSkip to conversation

mfd: s5m-core: return proper error if regmap_init_i2c fails

PATCH Applied Axel Lin 2 participants 2 messages Feb 28, 2012 – Mar 1, 2012 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mfd: s5m-core: return proper error if regmap_init_i2c fails

Also remove a redundant semicolon from return statement.

---
 drivers/mfd/s5m-core.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/mfd/s5m-core.c +4 -5
index 578e12e..48949d9 100644
@@ -62,7 +62,7 @@ EXPORT_SYMBOL_GPL(s5m_reg_read);
 
 int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
 {
-	return regmap_bulk_read(s5m87xx->regmap, reg, buf, count);;
+	return regmap_bulk_read(s5m87xx->regmap, reg, buf, count);
 }
 EXPORT_SYMBOL_GPL(s5m_bulk_read);
 
@@ -94,8 +94,7 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
 {
 	struct s5m_platform_data *pdata = i2c->dev.platform_data;
 	struct s5m87xx_dev *s5m87xx;
-	int ret = 0;
-	int error;
+	int ret;
 
 	s5m87xx = devm_kzalloc(&i2c->dev, sizeof(struct s5m87xx_dev),
 				GFP_KERNEL);
@@ -117,9 +116,9 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
 
 	s5m87xx->regmap = regmap_init_i2c(i2c, &s5m_regmap_config);
 	if (IS_ERR(s5m87xx->regmap)) {
-		error = PTR_ERR(s5m87xx->regmap);
+		ret = PTR_ERR(s5m87xx->regmap);
 		dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
-			error);
+			ret);
 		goto err;
 	}
 
Signature · 1 line
1.7.5.4
Applied
#1 lore raw

Hi Axel,

Quoted 1 line · Axel Lin

Also remove a redundant semicolon from return statement.

Thanks, applied.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/