Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586806 > unrolled thread

[PATCH v1 1/3] extcon: int3496: Propagate error code of gpiod_to_irq()

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2017-02-23 11:40 +0100
Last post2017-02-24 02:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v1 1/3] extcon: int3496: Propagate error code of gpiod_to_irq() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-02-23 11:40 +0100
    Re: [PATCH v1 1/3] extcon: int3496: Propagate error code of  gpiod_to_irq() Chanwoo Choi <cw00.choi@samsung.com> - 2017-02-24 02:20 +0100

#1586806 — [PATCH v1 1/3] extcon: int3496: Propagate error code of gpiod_to_irq()

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-02-23 11:40 +0100
Subject[PATCH v1 1/3] extcon: int3496: Propagate error code of gpiod_to_irq()
Message-ID<tdYYx-8q5-5@gated-at.bofh.it>
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>
---
 drivers/extcon/extcon-intel-int3496.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
index a3131b036de6..38eb6cab938f 100644
--- a/drivers/extcon/extcon-intel-int3496.c
+++ b/drivers/extcon/extcon-intel-int3496.c
@@ -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",
-- 
2.11.0

[toc] | [next] | [standalone]


#1587225 — Re: [PATCH v1 1/3] extcon: int3496: Propagate error code of gpiod_to_irq()

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-02-24 02:20 +0100
SubjectRe: [PATCH v1 1/3] extcon: int3496: Propagate error code of gpiod_to_irq()
Message-ID<tecI9-11o-11@gated-at.bofh.it>
In reply to#1586806
On 2017년 02월 23일 19:31, Andy Shevchenko wrote:
> 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>
> ---
>  drivers/extcon/extcon-intel-int3496.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
> index a3131b036de6..38eb6cab938f 100644
> --- a/drivers/extcon/extcon-intel-int3496.c
> +++ b/drivers/extcon/extcon-intel-int3496.c
> @@ -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",
> 

Applied it. Thanks.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web