Skip to content

Commit

Permalink
extcon: int3496: Propagate error code of gpiod_to_irq()
Browse files Browse the repository at this point in the history
gpiod_to_irq() doesn't return 0. Thus, we just adjust condition and
replace -EINVAL by actual error code it returns.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
  • Loading branch information
Andy Shevchenko authored and Chanwoo Choi committed Mar 13, 2017
1 parent 4495c08 commit bafa687
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/extcon/extcon-intel-int3496.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ static int int3496_probe(struct platform_device *pdev)
}

data->usb_id_irq = gpiod_to_irq(data->gpio_usb_id);
if (data->usb_id_irq <= 0) {
if (data->usb_id_irq < 0) {
dev_err(dev, "can't get USB ID IRQ: %d\n", data->usb_id_irq);
return -EINVAL;
return data->usb_id_irq;
}

data->gpio_vbus_en = devm_gpiod_get_index(dev, "vbus en",
Expand Down

0 comments on commit bafa687

Please sign in to comment.