From: Javier Martinez Canillas <martinez.javier@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH Resend] bt8xxgpio: Check gpiochip_remove() result
Date: Mon, 12 Oct 2009 05:45:44 +0000 [thread overview]
Message-ID: <1255326344.23361.4.camel@laptop> (raw)
Resending the patch, forgot about checkpatch.pl
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
drivers/gpio/bt8xxgpio.c | 33 +++++++++++++++++++--------------
1 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/gpio/bt8xxgpio.c b/drivers/gpio/bt8xxgpio.c
index 2559f22..b4aa126 100644
--- a/drivers/gpio/bt8xxgpio.c
+++ b/drivers/gpio/bt8xxgpio.c
@@ -242,20 +242,25 @@ err_freebg:
static void bt8xxgpio_remove(struct pci_dev *pdev)
{
struct bt8xxgpio *bg = pci_get_drvdata(pdev);
-
- gpiochip_remove(&bg->gpio);
-
- bgwrite(0, BT848_INT_MASK);
- bgwrite(~0x0, BT848_INT_STAT);
- bgwrite(0x0, BT848_GPIO_OUT_EN);
-
- iounmap(bg->mmio);
- release_mem_region(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
- pci_disable_device(pdev);
-
- pci_set_drvdata(pdev, NULL);
- kfree(bg);
+ int ret;
+
+ ret = gpiochip_remove(&bg->gpio);
+
+ if (!ret) {
+ bgwrite(0, BT848_INT_MASK);
+ bgwrite(~0x0, BT848_INT_STAT);
+ bgwrite(0x0, BT848_GPIO_OUT_EN);
+
+ iounmap(bg->mmio);
+ release_mem_region(pci_resource_start(pdev, 0),
+ pci_resource_len(pdev, 0));
+ pci_disable_device(pdev);
+
+ pci_set_drvdata(pdev, NULL);
+ kfree(bg);
+ } else
+ dev_err(&pdev->dev, "Failed to remove the GPIO controller:
+ %d\n", ret);
}
#ifdef CONFIG_PM
--
1.6.0.4
next reply other threads:[~2009-10-12 5:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-12 5:45 Javier Martinez Canillas [this message]
2009-10-12 6:20 ` [PATCH Resend] bt8xxgpio: Check gpiochip_remove() result Javier Martinez Canillas
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=1255326344.23361.4.camel@laptop \
--to=martinez.javier@gmail.com \
--cc=kernel-janitors@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