summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-adp5588.c
diff options
context:
space:
mode:
authorVarka Bhadram <varkabhadram@gmail.com>2015-03-31 07:19:08 +0300
committerLinus Walleij <linus.walleij@linaro.org>2015-04-08 10:54:05 +0300
commit7898b31ebafbf01d2ad56d251cfc9bfa4e5c644a (patch)
tree42e9370e7dc2765dad94947021d79fb106c4e92d /drivers/gpio/gpio-adp5588.c
parentd1e10dc8c104d533547f6e499550fafc36809943 (diff)
downloadlinux-7898b31ebafbf01d2ad56d251cfc9bfa4e5c644a.tar.xz
gpio: use devm_kzalloc
We can use devres API for allocating memory. No need of using kfree. Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-adp5588.c')
-rw-r--r--drivers/gpio/gpio-adp5588.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
index 3beed6ea8c65..0de8c7008122 100644
--- a/drivers/gpio/gpio-adp5588.c
+++ b/drivers/gpio/gpio-adp5588.c
@@ -378,7 +378,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
return -EIO;
}
- dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+ dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL);
if (dev == NULL)
return -ENOMEM;
@@ -446,7 +446,6 @@ static int adp5588_gpio_probe(struct i2c_client *client,
err_irq:
adp5588_irq_teardown(dev);
err:
- kfree(dev);
return ret;
}