aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-24 22:06:40 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-09 11:51:50 -0400
commit0ef4619c74ef1e24e9ee340f95ee922f970cde54 (patch)
tree8fe1bba434d06351be9f77373772b7c82baceb7d /drivers
parent1d88f7a01d9588b3298cfd6a2ec30538e96d166e (diff)
mfd: Convert tps65217 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/tps65217.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index f7d854e4cc62..c064c0a05649 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -150,7 +150,7 @@ static int __devinit tps65217_probe(struct i2c_client *client,
150 return -ENOMEM; 150 return -ENOMEM;
151 151
152 tps->pdata = pdata; 152 tps->pdata = pdata;
153 tps->regmap = regmap_init_i2c(client, &tps65217_regmap_config); 153 tps->regmap = devm_regmap_init_i2c(client, &tps65217_regmap_config);
154 if (IS_ERR(tps->regmap)) { 154 if (IS_ERR(tps->regmap)) {
155 ret = PTR_ERR(tps->regmap); 155 ret = PTR_ERR(tps->regmap);
156 dev_err(tps->dev, "Failed to allocate register map: %d\n", 156 dev_err(tps->dev, "Failed to allocate register map: %d\n",
@@ -163,9 +163,9 @@ static int __devinit tps65217_probe(struct i2c_client *client,
163 163
164 ret = tps65217_reg_read(tps, TPS65217_REG_CHIPID, &version); 164 ret = tps65217_reg_read(tps, TPS65217_REG_CHIPID, &version);
165 if (ret < 0) { 165 if (ret < 0) {
166 dev_err(tps->dev, "Failed to read revision" 166 dev_err(tps->dev, "Failed to read revision register: %d\n",
167 " register: %d\n", ret); 167 ret);
168 goto err_regmap; 168 return ret;
169 } 169 }
170 170
171 dev_info(tps->dev, "TPS65217 ID %#x version 1.%d\n", 171 dev_info(tps->dev, "TPS65217 ID %#x version 1.%d\n",
@@ -190,11 +190,6 @@ static int __devinit tps65217_probe(struct i2c_client *client,
190 } 190 }
191 191
192 return 0; 192 return 0;
193
194err_regmap:
195 regmap_exit(tps->regmap);
196
197 return ret;
198} 193}
199 194
200static int __devexit tps65217_remove(struct i2c_client *client) 195static int __devexit tps65217_remove(struct i2c_client *client)
@@ -205,8 +200,6 @@ static int __devexit tps65217_remove(struct i2c_client *client)
205 for (i = 0; i < TPS65217_NUM_REGULATOR; i++) 200 for (i = 0; i < TPS65217_NUM_REGULATOR; i++)
206 platform_device_unregister(tps->regulator_pdev[i]); 201 platform_device_unregister(tps->regulator_pdev[i]);
207 202
208 regmap_exit(tps->regmap);
209
210 return 0; 203 return 0;
211} 204}
212 205