aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-23 16:25:03 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-13 12:13:39 +0200
commita1ace0aac5a83b859c2ddeb5dfb032b9b6dcd9cf (patch)
tree847a53eae972d0c337c8da2775c04cbad408c30e /drivers/mfd
parentmfd: max8925: Convert to managed resources for allocating memory (diff)
downloadlinux-dev-a1ace0aac5a83b859c2ddeb5dfb032b9b6dcd9cf.tar.xz
linux-dev-a1ace0aac5a83b859c2ddeb5dfb032b9b6dcd9cf.zip
mfd: 88pm860x: Convert to managed resources for allocating memory
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/88pm860x-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 629d6404cab4..eeb481d426b5 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1150,7 +1150,8 @@ static int pm860x_probe(struct i2c_client *client,
return -EINVAL;
}
- chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL);
+ chip = devm_kzalloc(&client->dev,
+ sizeof(struct pm860x_chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;
@@ -1160,7 +1161,6 @@ static int pm860x_probe(struct i2c_client *client,
ret = PTR_ERR(chip->regmap);
dev_err(&client->dev, "Failed to allocate register map: %d\n",
ret);
- kfree(chip);
return ret;
}
chip->client = client;
@@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client)
regmap_exit(chip->regmap_companion);
i2c_unregister_device(chip->companion);
}
- kfree(chip);
return 0;
}