Skip to contentSkip to conversation

ASoC: STA529: fix an error message

PATCH Applied Dan Carpenter 3 participants 3 messages Jul 11, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: STA529: fix an error message

GCC complains that "ret" is uninitialized here.

sound/soc/codecs/sta529.c +2 -1
index a9f34c7..0c225cd 100644
@@ -397,8 +397,9 @@ static __devinit int sta529_i2c_probe(struct i2c_client *i2c,
 
 	sta529->regmap = devm_regmap_init_i2c(i2c, &sta529_regmap);
 	if (IS_ERR(sta529->regmap)) {
+		ret = PTR_ERR(sta529->regmap);
 		dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
-		return PTR_ERR(sta529->regmap);
+		return ret;
 	}
 
 	i2c_set_clientdata(i2c, sta529);
Acked-by on v1 1/1
#1 lore raw

Hello Dan,

Quoted 19 lines · Dan Carpenter

GCC complains that "ret" is uninitialized here.

sound/soc/codecs/sta529.c +2 -1
index a9f34c7..0c225cd 100644
@@ -397,8 +397,9 @@ static __devinit int sta529_i2c_probe(struct i2c_client *i2c,
 
  	sta529->regmap = devm_regmap_init_i2c(i2c,&sta529_regmap);
  	if (IS_ERR(sta529->regmap)) {
+		ret = PTR_ERR(sta529->regmap);
  		dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
-		return PTR_ERR(sta529->regmap);
+		return ret;
  	}
 
  	i2c_set_clientdata(i2c, sta529);
Quoted 2 lines

.

Thanks for the patch.

~Rajeev