diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-24 22:03:44 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-05-09 11:50:53 -0400 |
commit | 1092e1c761dd0dc92a431085e322956d91d057a6 (patch) | |
tree | 042f96afa74f3d149705ba483bd2ba8f23f077a9 | |
parent | f8dddc0cfe9f56ed74fd5efde8d0754f5fb73a3f (diff) |
mfd: Convert s5m-core to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/s5m-core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mfd/s5m-core.c b/drivers/mfd/s5m-core.c index 48949d998d10..dd170307e60e 100644 --- a/drivers/mfd/s5m-core.c +++ b/drivers/mfd/s5m-core.c | |||
@@ -114,12 +114,12 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c, | |||
114 | s5m87xx->wakeup = pdata->wakeup; | 114 | s5m87xx->wakeup = pdata->wakeup; |
115 | } | 115 | } |
116 | 116 | ||
117 | s5m87xx->regmap = regmap_init_i2c(i2c, &s5m_regmap_config); | 117 | s5m87xx->regmap = devm_regmap_init_i2c(i2c, &s5m_regmap_config); |
118 | if (IS_ERR(s5m87xx->regmap)) { | 118 | if (IS_ERR(s5m87xx->regmap)) { |
119 | ret = PTR_ERR(s5m87xx->regmap); | 119 | ret = PTR_ERR(s5m87xx->regmap); |
120 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | 120 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
121 | ret); | 121 | ret); |
122 | goto err; | 122 | return ret; |
123 | } | 123 | } |
124 | 124 | ||
125 | s5m87xx->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR); | 125 | s5m87xx->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR); |
@@ -159,7 +159,6 @@ err: | |||
159 | mfd_remove_devices(s5m87xx->dev); | 159 | mfd_remove_devices(s5m87xx->dev); |
160 | s5m_irq_exit(s5m87xx); | 160 | s5m_irq_exit(s5m87xx); |
161 | i2c_unregister_device(s5m87xx->rtc); | 161 | i2c_unregister_device(s5m87xx->rtc); |
162 | regmap_exit(s5m87xx->regmap); | ||
163 | return ret; | 162 | return ret; |
164 | } | 163 | } |
165 | 164 | ||
@@ -170,7 +169,6 @@ static int s5m87xx_i2c_remove(struct i2c_client *i2c) | |||
170 | mfd_remove_devices(s5m87xx->dev); | 169 | mfd_remove_devices(s5m87xx->dev); |
171 | s5m_irq_exit(s5m87xx); | 170 | s5m_irq_exit(s5m87xx); |
172 | i2c_unregister_device(s5m87xx->rtc); | 171 | i2c_unregister_device(s5m87xx->rtc); |
173 | regmap_exit(s5m87xx->regmap); | ||
174 | return 0; | 172 | return 0; |
175 | } | 173 | } |
176 | 174 | ||