diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-03-10 02:58:18 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 14:45:01 -0400 |
commit | 955b44304afca143b82304fe421e990ec607834a (patch) | |
tree | f0046ed726b7c677d6d70d256c816573cb503932 /drivers/media/rc | |
parent | 23bfb5be9f4c14937d70ed09f24a19d86df1951b (diff) |
[media] gpio-ir-recv: a couple signedness bugs
There are couple places where we check unsigned values for negative. I
changed ->gpin_nr to signed because in gpio_ir_recv_probe() we do:
if (pdata->gpio_nr < 0)
return -EINVAL;
I also change gval to a signed int in gpio_ir_recv_irq() because that's
the type that gpio_get_value_cansleep() returns and we test for negative
returns.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Trilok Soni <tsoni@codeaurora.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/gpio-ir-recv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 6744479a5389..0d875450c5ce 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c | |||
@@ -26,14 +26,14 @@ | |||
26 | 26 | ||
27 | struct gpio_rc_dev { | 27 | struct gpio_rc_dev { |
28 | struct rc_dev *rcdev; | 28 | struct rc_dev *rcdev; |
29 | unsigned int gpio_nr; | 29 | int gpio_nr; |
30 | bool active_low; | 30 | bool active_low; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) | 33 | static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) |
34 | { | 34 | { |
35 | struct gpio_rc_dev *gpio_dev = dev_id; | 35 | struct gpio_rc_dev *gpio_dev = dev_id; |
36 | unsigned int gval; | 36 | int gval; |
37 | int rc = 0; | 37 | int rc = 0; |
38 | enum raw_event_type type = IR_SPACE; | 38 | enum raw_event_type type = IR_SPACE; |
39 | 39 | ||