Commit 373e9644 authored by Ben Dooks's avatar Ben Dooks

[ARM] S3C24XX: GPIO: Fix error returns from gpio functions

Several GPIO functions have been returning -1 to indicate
an error instead of returning a proper error code. Change
to return -EINVAL for invalid argument(s).
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 070276d5
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
int s3c2400_gpio_getirq(unsigned int pin) int s3c2400_gpio_getirq(unsigned int pin)
{ {
if (pin < S3C2410_GPE(0) || pin > S3C2400_GPE7_EINT7) if (pin < S3C2410_GPE(0) || pin > S3C2400_GPE(7))
return -1; /* not valid interrupts */ return -EINVAL; /* not valid interrupts */
return (pin - S3C2410_GPE(0)) + IRQ_EINT0; return (pin - S3C2410_GPE(0)) + IRQ_EINT0;
} }
......
...@@ -40,7 +40,7 @@ int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, ...@@ -40,7 +40,7 @@ int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
unsigned long val; unsigned long val;
if (pin < S3C2410_GPG(8) || pin > S3C2410_GPG(15)) if (pin < S3C2410_GPG(8) || pin > S3C2410_GPG(15))
return -1; return -EINVAL;
config &= 0xff; config &= 0xff;
......
...@@ -184,10 +184,10 @@ EXPORT_SYMBOL(s3c2410_modify_misccr); ...@@ -184,10 +184,10 @@ EXPORT_SYMBOL(s3c2410_modify_misccr);
int s3c2410_gpio_getirq(unsigned int pin) int s3c2410_gpio_getirq(unsigned int pin)
{ {
if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15))
return -1; /* not valid interrupts */ return -EINVAL; /* not valid interrupts */
if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7))
return -1; /* not valid pin */ return -EINVAL; /* not valid pin */
if (pin < S3C2410_GPF(4)) if (pin < S3C2410_GPF(4))
return (pin - S3C2410_GPF(0)) + IRQ_EINT0; return (pin - S3C2410_GPF(0)) + IRQ_EINT0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment