linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: mxc: Do not hard code return value
@ 2013-12-21  7:35 Sachin Kamat
  2013-12-21  7:35 ` [PATCH 2/2] gpio: mvebu: Do not hard code error code Sachin Kamat
  2014-01-02 12:56 ` [PATCH 1/2] gpio: mxc: Do not hard code return value Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-12-21  7:35 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, sachin.kamat

Silences the following warning:
why not propagate 'port->irq' from platform_get_irq() instead of (-22)?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/gpio/gpio-mxc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 3307f6db3a92..db83b3c0a449 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -422,7 +422,7 @@ static int mxc_gpio_probe(struct platform_device *pdev)
 	port->irq_high = platform_get_irq(pdev, 1);
 	port->irq = platform_get_irq(pdev, 0);
 	if (port->irq < 0)
-		return -EINVAL;
+		return port->irq;
 
 	/* disable the interrupt and clear the status */
 	writel(0, port->base + GPIO_IMR);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gpio: mvebu: Do not hard code error code
  2013-12-21  7:35 [PATCH 1/2] gpio: mxc: Do not hard code return value Sachin Kamat
@ 2013-12-21  7:35 ` Sachin Kamat
  2014-01-02 12:57   ` Linus Walleij
  2014-01-02 12:56 ` [PATCH 1/2] gpio: mxc: Do not hard code return value Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2013-12-21  7:35 UTC (permalink / raw)
  To: linux-gpio; +Cc: linus.walleij, sachin.kamat

Return the appropriate error code instead of hardcoding it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/gpio/gpio-mvebu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index bc78a9da5502..3b1fd1ce460f 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -676,7 +676,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
 	mvchip->irqbase = irq_alloc_descs(-1, 0, ngpios, -1);
 	if (mvchip->irqbase < 0) {
 		dev_err(&pdev->dev, "no irqs\n");
-		return -ENOMEM;
+		return mvchip->irqbase;
 	}
 
 	gc = irq_alloc_generic_chip("mvebu_gpio_irq", 2, mvchip->irqbase,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] gpio: mxc: Do not hard code return value
  2013-12-21  7:35 [PATCH 1/2] gpio: mxc: Do not hard code return value Sachin Kamat
  2013-12-21  7:35 ` [PATCH 2/2] gpio: mvebu: Do not hard code error code Sachin Kamat
@ 2014-01-02 12:56 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-01-02 12:56 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-gpio@vger.kernel.org

On Sat, Dec 21, 2013 at 8:35 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:

> Silences the following warning:
> why not propagate 'port->irq' from platform_get_irq() instead of (-22)?
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] gpio: mvebu: Do not hard code error code
  2013-12-21  7:35 ` [PATCH 2/2] gpio: mvebu: Do not hard code error code Sachin Kamat
@ 2014-01-02 12:57   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-01-02 12:57 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-gpio@vger.kernel.org

On Sat, Dec 21, 2013 at 8:35 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:

> Return the appropriate error code instead of hardcoding it.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-02 12:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-21  7:35 [PATCH 1/2] gpio: mxc: Do not hard code return value Sachin Kamat
2013-12-21  7:35 ` [PATCH 2/2] gpio: mvebu: Do not hard code error code Sachin Kamat
2014-01-02 12:57   ` Linus Walleij
2014-01-02 12:56 ` [PATCH 1/2] gpio: mxc: Do not hard code return value Linus Walleij

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).