diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-02-28 01:23:55 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-06 12:46:54 -0500 |
commit | 61a2af301fa145490868fcf36b4bbea22398f760 (patch) | |
tree | 1f6fc787a0adb8bddacfbd03c29c2c4916166554 /drivers/mfd | |
parent | b3b97473ee07ae8904e9d8fe02914de2188d302c (diff) |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/s5m-core.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mfd/s5m-core.c b/drivers/mfd/s5m-core.c index 578e12e7f67..48949d998d1 100644 --- a/drivers/mfd/s5m-core.c +++ b/drivers/mfd/s5m-core.c | |||
@@ -62,7 +62,7 @@ EXPORT_SYMBOL_GPL(s5m_reg_read); | |||
62 | 62 | ||
63 | int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf) | 63 | int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf) |
64 | { | 64 | { |
65 | return regmap_bulk_read(s5m87xx->regmap, reg, buf, count);; | 65 | return regmap_bulk_read(s5m87xx->regmap, reg, buf, count); |
66 | } | 66 | } |
67 | EXPORT_SYMBOL_GPL(s5m_bulk_read); | 67 | EXPORT_SYMBOL_GPL(s5m_bulk_read); |
68 | 68 | ||
@@ -94,8 +94,7 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c, | |||
94 | { | 94 | { |
95 | struct s5m_platform_data *pdata = i2c->dev.platform_data; | 95 | struct s5m_platform_data *pdata = i2c->dev.platform_data; |
96 | struct s5m87xx_dev *s5m87xx; | 96 | struct s5m87xx_dev *s5m87xx; |
97 | int ret = 0; | 97 | int ret; |
98 | int error; | ||
99 | 98 | ||
100 | s5m87xx = devm_kzalloc(&i2c->dev, sizeof(struct s5m87xx_dev), | 99 | s5m87xx = devm_kzalloc(&i2c->dev, sizeof(struct s5m87xx_dev), |
101 | GFP_KERNEL); | 100 | GFP_KERNEL); |
@@ -117,9 +116,9 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c, | |||
117 | 116 | ||
118 | s5m87xx->regmap = regmap_init_i2c(i2c, &s5m_regmap_config); | 117 | s5m87xx->regmap = regmap_init_i2c(i2c, &s5m_regmap_config); |
119 | if (IS_ERR(s5m87xx->regmap)) { | 118 | if (IS_ERR(s5m87xx->regmap)) { |
120 | error = PTR_ERR(s5m87xx->regmap); | 119 | ret = PTR_ERR(s5m87xx->regmap); |
121 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | 120 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
122 | error); | 121 | ret); |
123 | goto err; | 122 | goto err; |
124 | } | 123 | } |
125 | 124 | ||