From b6d71fdbab9db265454e99b480081acc971dea59 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Mon, 14 Apr 2014 15:30:41 +0800 Subject: [PATCH] gpio: max730x: Remove kfree(ts) in __max730x_remove() The memory for ts is allocated by devm_kzalloc now, so the kfree is not required. Signed-off-by: Axel Lin Acked-by: Juergen Beisert Reviewed-by: Jingoo Han Signed-off-by: Linus Walleij --- drivers/gpio/gpio-max730x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c index 8672755f95c9..0814584fcdc1 100644 --- a/drivers/gpio/gpio-max730x.c +++ b/drivers/gpio/gpio-max730x.c @@ -237,10 +237,9 @@ int __max730x_remove(struct device *dev) ts->write(dev, 0x04, 0x00); ret = gpiochip_remove(&ts->chip); - if (!ret) { + if (!ret) mutex_destroy(&ts->lock); - kfree(ts); - } else + else dev_err(dev, "Failed to remove GPIO controller: %d\n", ret); return ret; -- 2.20.1