diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-06-29 15:14:36 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-07-09 00:16:08 +0200 |
commit | e7c706b1e5ccf28eaaf76c7a4613e80b0ca52863 (patch) | |
tree | 70e260841527b64e699bbc41d907fdc10cd332f6 /drivers/mfd/mc13xxx-i2c.c | |
parent | e4ecf6ea84d68aea5a9785e89f52672e1e126998 (diff) | |
download | linux-e7c706b1e5ccf28eaaf76c7a4613e80b0ca52863.tar.bz2 |
mfd: Use devm_* APIs for mc13xxx
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/mc13xxx-i2c.c')
-rw-r--r-- | drivers/mfd/mc13xxx-i2c.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index d22501dad6a6..18d29f3ca67f 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c @@ -63,7 +63,7 @@ static int mc13xxx_i2c_probe(struct i2c_client *client, if (of_id) idrv->id_table = (const struct i2c_device_id*) of_id->data; - mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL); + mc13xxx = devm_kzalloc(&client->dev, sizeof(*mc13xxx), GFP_KERNEL); if (!mc13xxx) return -ENOMEM; @@ -72,13 +72,13 @@ static int mc13xxx_i2c_probe(struct i2c_client *client, mc13xxx->dev = &client->dev; mutex_init(&mc13xxx->lock); - mc13xxx->regmap = regmap_init_i2c(client, &mc13xxx_regmap_i2c_config); + mc13xxx->regmap = devm_regmap_init_i2c(client, + &mc13xxx_regmap_i2c_config); if (IS_ERR(mc13xxx->regmap)) { ret = PTR_ERR(mc13xxx->regmap); dev_err(mc13xxx->dev, "Failed to initialize register map: %d\n", ret); dev_set_drvdata(&client->dev, NULL); - kfree(mc13xxx); return ret; } |