From: Linus Walleij <linus.walleij@linaro.org>
To: linux-gpio@vger.kernel.org,
Alexandre Courbot <acourbot@nvidia.com>,
Johan Hovold <johan@kernel.org>,
Michael Welling <mwelling@ieee.org>,
Markus Pargmann <mpa@pengutronix.de>
Cc: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>,
Grant Likely <grant.likely@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 1/6] gpio: remember to finally free gpio_device
Date: Thu, 11 Feb 2016 11:26:18 +0100 [thread overview]
Message-ID: <1455186383-28004-2-git-send-email-linus.walleij@linaro.org> (raw)
In-Reply-To: <1455186383-28004-1-git-send-email-linus.walleij@linaro.org>
When the device core reference count for the device goes to
0 and it calls .release() we free resources and so can also
finally free up the GPIO state container, struct gpio_device.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/gpio/gpiolib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 70e0fff0a8a7..36f8be3f910b 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -405,6 +405,7 @@ static void gpiodevice_release(struct device *dev)
cdev_del(&gdev->chrdev);
list_del(&gdev->list);
ida_simple_remove(&gpio_ida, gdev->id);
+ kfree(gdev);
}
/**
--
2.4.3
next prev parent reply other threads:[~2016-02-11 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 10:26 [PATCH 0/6] gpiolib refactorings after device addition Linus Walleij
2016-02-11 10:26 ` Linus Walleij [this message]
2016-02-11 10:26 ` [PATCH 2/6] gpio: move sysfs mock device to the gpio_device Linus Walleij
2016-02-11 10:26 ` [PATCH 3/6] gpio: move descriptors into gpio_device Linus Walleij
2016-02-11 10:26 ` [PATCH 4/6] gpio: reflect base and ngpio " Linus Walleij
2016-02-11 10:26 ` [PATCH 5/6] gpio: reference count the gpio device for each desc Linus Walleij
2016-02-11 10:26 ` [PATCH 6/6] gpio: move the pin ranges into gpio_device Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455186383-28004-2-git-send-email-linus.walleij@linaro.org \
--to=linus.walleij@linaro.org \
--cc=acourbot@nvidia.com \
--cc=bamvor.zhangjian@linaro.org \
--cc=grant.likely@linaro.org \
--cc=johan@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mpa@pengutronix.de \
--cc=mwelling@ieee.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).