From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: linus.walleij@linaro.org, gnurou@gmail.com
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
William Breathitt Gray <vilhelm.gray@gmail.com>
Subject: [PATCH 4/5] gpio: gpio-mm: Utilize devm_ functions in driver probe callback
Date: Tue, 24 Jan 2017 15:01:04 -0500 [thread overview]
Message-ID: <010e1799ddc02e5f41c2cebded47ed5478b3d7b6.1485287208.git.vilhelm.gray@gmail.com> (raw)
In-Reply-To: <cover.1485287208.git.vilhelm.gray@gmail.com>
The devm_ resource manager functions allow memory to be automatically
released when a device is unbound. This patch takes advantage of the
resource manager functions and replaces the gpiochip_add_data call with
the devm_gpiochip_add_data call. In addition, the gpiomm_remove function
has been removed as no longer necessary due to the use of the relevant
devm_ resource manager functions.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
drivers/gpio/gpio-gpio-mm.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-gpio-mm.c b/drivers/gpio/gpio-gpio-mm.c
index 1e7def9449ce..c2837ce64ea3 100644
--- a/drivers/gpio/gpio-gpio-mm.c
+++ b/drivers/gpio/gpio-gpio-mm.c
@@ -224,7 +224,7 @@ static int gpiomm_probe(struct device *dev, unsigned int id)
dev_set_drvdata(dev, gpiommgpio);
- err = gpiochip_add_data(&gpiommgpio->chip, gpiommgpio);
+ err = devm_gpiochip_add_data(dev, &gpiommgpio->chip, gpiommgpio);
if (err) {
dev_err(dev, "GPIO registering failed (%d)\n", err);
return err;
@@ -243,21 +243,11 @@ static int gpiomm_probe(struct device *dev, unsigned int id)
return 0;
}
-static int gpiomm_remove(struct device *dev, unsigned int id)
-{
- struct gpiomm_gpio *const gpiommgpio = dev_get_drvdata(dev);
-
- gpiochip_remove(&gpiommgpio->chip);
-
- return 0;
-}
-
static struct isa_driver gpiomm_driver = {
.probe = gpiomm_probe,
.driver = {
.name = "gpio-mm"
},
- .remove = gpiomm_remove
};
module_isa_driver(gpiomm_driver, num_gpiomm);
--
2.11.0
next prev parent reply other threads:[~2017-01-24 20:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 20:00 [PATCH 0/5] gpio: Utilize devm_ functions in driver probe callbacks William Breathitt Gray
2017-01-24 20:00 ` [PATCH 1/5] gpio: 104-dio-48e: Utilize devm_ functions in driver probe callback William Breathitt Gray
2017-01-26 14:53 ` Linus Walleij
2017-01-24 20:00 ` [PATCH 2/5] gpio: 104-idi-48: " William Breathitt Gray
2017-01-26 14:53 ` Linus Walleij
2017-01-24 20:00 ` [PATCH 3/5] gpio: 104-idio-16: " William Breathitt Gray
2017-01-26 14:54 ` Linus Walleij
2017-01-24 20:01 ` William Breathitt Gray [this message]
2017-01-26 14:55 ` [PATCH 4/5] gpio: gpio-mm: " Linus Walleij
2017-01-24 20:01 ` [PATCH 5/5] gpio: ws16c48: " William Breathitt Gray
2017-01-26 14:57 ` 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=010e1799ddc02e5f41c2cebded47ed5478b3d7b6.1485287208.git.vilhelm.gray@gmail.com \
--to=vilhelm.gray@gmail.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®