mfd: Return proper error if s5m-core regmap_init_i2c fails

Also remove a redundant semicolon from return statement.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Axel Lin 2012-02-28 14:23:55 +08:00 коммит произвёл Samuel Ortiz
Родитель b3b97473ee
Коммит 61a2af301f
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -62,7 +62,7 @@ EXPORT_SYMBOL_GPL(s5m_reg_read);
int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf) 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); 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 s5m_platform_data *pdata = i2c->dev.platform_data;
struct s5m87xx_dev *s5m87xx; struct s5m87xx_dev *s5m87xx;
int ret = 0; int ret;
int error;
s5m87xx = devm_kzalloc(&i2c->dev, sizeof(struct s5m87xx_dev), s5m87xx = devm_kzalloc(&i2c->dev, sizeof(struct s5m87xx_dev),
GFP_KERNEL); GFP_KERNEL);
@ -117,9 +116,9 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
s5m87xx->regmap = regmap_init_i2c(i2c, &s5m_regmap_config); s5m87xx->regmap = regmap_init_i2c(i2c, &s5m_regmap_config);
if (IS_ERR(s5m87xx->regmap)) { 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", dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
error); ret);
goto err; goto err;
} }