linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/11] ARM: at92/udc: use gpio_is_valid to check the gpio
Date: Sun, 16 Oct 2011 21:09:17 +0200	[thread overview]
Message-ID: <1318792160-23279-8-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20111016190528.GI1459@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/usb/gadget/at91_udc.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index ddb118a..205498d 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1758,7 +1758,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
 
 	/* rm9200 needs manual D+ pullup; off by default */
 	if (cpu_is_at91rm9200()) {
-		if (udc->board.pullup_pin <= 0) {
+		if (gpio_is_valid(udc->board.pullup_pin)) {
 			DBG("no D+ pullup?\n");
 			retval = -ENODEV;
 			goto fail0;
@@ -1825,7 +1825,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
 		DBG("request irq %d failed\n", udc->udp_irq);
 		goto fail1;
 	}
-	if (udc->board.vbus_pin > 0) {
+	if (gpio_is_valid(udc->board.vbus_pin)) {
 		retval = gpio_request(udc->board.vbus_pin, "udc_vbus");
 		if (retval < 0) {
 			DBG("request vbus pin failed\n");
@@ -1869,10 +1869,10 @@ static int __init at91udc_probe(struct platform_device *pdev)
 	INFO("%s version %s\n", driver_name, DRIVER_VERSION);
 	return 0;
 fail4:
-	if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled)
+	if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled)
 		free_irq(udc->board.vbus_pin, udc);
 fail3:
-	if (udc->board.vbus_pin > 0)
+	if (gpio_is_valid(udc->board.vbus_pin))
 		gpio_free(udc->board.vbus_pin);
 fail2:
 	free_irq(udc->udp_irq, udc);
@@ -1907,7 +1907,7 @@ static int __exit at91udc_remove(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 0);
 	remove_debug_file(udc);
-	if (udc->board.vbus_pin > 0) {
+	if (gpio_is_valid(udc->board.vbus_pin)) {
 		free_irq(udc->board.vbus_pin, udc);
 		gpio_free(udc->board.vbus_pin);
 	}
@@ -1951,7 +1951,7 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)
 		enable_irq_wake(udc->udp_irq);
 
 	udc->active_suspend = wake;
-	if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled && wake)
+	if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled && wake)
 		enable_irq_wake(udc->board.vbus_pin);
 	return 0;
 }
@@ -1961,7 +1961,7 @@ static int at91udc_resume(struct platform_device *pdev)
 	struct at91_udc *udc = platform_get_drvdata(pdev);
 	unsigned long	flags;
 
-	if (udc->board.vbus_pin > 0 && !udc->board.vbus_polled &&
+	if (gpio_is_valid(udc->board.vbus_pin) && !udc->board.vbus_polled &&
 	    udc->active_suspend)
 		disable_irq_wake(udc->board.vbus_pin);
 
-- 
1.7.7

  parent reply	other threads:[~2011-10-16 19:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-16 19:05 [PATCH 0/11 v3] ARM: AT91: update gpio implementation Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 01/11] ARM: at91/gpio: make gpio register base soc independant Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 02/11] ARM: at91/boards: use -EINVAL for invalid gpio Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 03/11] ARM: at91/soc: use gpio_is_valid to check the gpio Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 04/11] ARM: at91/pata: " Jean-Christophe PLAGNIOL-VILLARD
2011-10-17 10:54   ` Sergei Shtylyov
2011-10-17 12:24     ` Jean-Christophe PLAGNIOL-VILLARD
2011-10-18 11:21       ` Sergei Shtylyov
2011-10-18 11:24         ` Sergei Shtylyov
2011-10-16 19:09 ` [PATCH 05/11] ARM: at91/ide: " Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 06/11] ARM: at91/mmc: " Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 07/11] ARM: at92/nand: " Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-10-16 19:09 ` [PATCH 09/11] ARM: at92/ohci: " Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 10/11] ARM: at91/gpio: drop PIN_BASE Jean-Christophe PLAGNIOL-VILLARD
2011-10-16 19:09 ` [PATCH 11/11] ARM: at91/gpio: fix display of number of irq setuped Jean-Christophe PLAGNIOL-VILLARD

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=1318792160-23279-8-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=linux-arm-kernel@lists.infradead.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).