diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-05-23 16:25:02 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 12:11:39 +0200 |
commit | b3fff1770a33abb1905eae2baa8dffd48e5913ae (patch) | |
tree | 971a3ba74267bfe4a17319e599bcb3df9ecddbc7 /drivers/mfd/tps65912-i2c.c | |
parent | c5fa44d13496eba51ab58ac0d1502825543f51aa (diff) | |
download | op-kernel-dev-b3fff1770a33abb1905eae2baa8dffd48e5913ae.zip op-kernel-dev-b3fff1770a33abb1905eae2baa8dffd48e5913ae.tar.gz |
mfd: tps65912: Convert to managed resources for allocating memory
Saves on code and simplifies the driver, as these resources are now
tracked and freed automatically when the driver is realised.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/tps65912-i2c.c')
-rw-r--r-- | drivers/mfd/tps65912-i2c.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mfd/tps65912-i2c.c b/drivers/mfd/tps65912-i2c.c index c041f2c..6a6343e 100644 --- a/drivers/mfd/tps65912-i2c.c +++ b/drivers/mfd/tps65912-i2c.c @@ -77,7 +77,8 @@ static int tps65912_i2c_probe(struct i2c_client *i2c, { struct tps65912 *tps65912; - tps65912 = kzalloc(sizeof(struct tps65912), GFP_KERNEL); + tps65912 = devm_kzalloc(&i2c->dev, + sizeof(struct tps65912), GFP_KERNEL); if (tps65912 == NULL) return -ENOMEM; |