All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe
@ 2023-03-06  2:45 ` Dongliang Mu
  0 siblings, 0 replies; 6+ messages in thread
From: Dongliang Mu @ 2023-03-06  2:45 UTC (permalink / raw)
  To: Sekhar Nori, Bartosz Golaszewski
  Cc: Dongliang Mu, linux-arm-kernel, linux-i2c, linux-kernel

From the comment of platform_get_irq, it only returns non-zero IRQ
number and negative error number, other than zero.

Fix this by removing the if condition.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
---
 drivers/i2c/busses/i2c-davinci.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index c836cf884185..9750310f2c96 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
 	int r, irq;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		if (!irq)
-			irq = -ENXIO;
+	if (irq < 0)
 		return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
-	}
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
 			GFP_KERNEL);
-- 
2.39.2


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

* [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe
@ 2023-03-06  2:45 ` Dongliang Mu
  0 siblings, 0 replies; 6+ messages in thread
From: Dongliang Mu @ 2023-03-06  2:45 UTC (permalink / raw)
  To: Sekhar Nori, Bartosz Golaszewski
  Cc: Dongliang Mu, linux-arm-kernel, linux-i2c, linux-kernel

From the comment of platform_get_irq, it only returns non-zero IRQ
number and negative error number, other than zero.

Fix this by removing the if condition.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
---
 drivers/i2c/busses/i2c-davinci.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index c836cf884185..9750310f2c96 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
 	int r, irq;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		if (!irq)
-			irq = -ENXIO;
+	if (irq < 0)
 		return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
-	}
 
 	dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
 			GFP_KERNEL);
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe
  2023-03-06  2:45 ` Dongliang Mu
@ 2023-03-06  9:27   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2023-03-06  9:27 UTC (permalink / raw)
  To: Dongliang Mu; +Cc: Sekhar Nori, linux-arm-kernel, linux-i2c, linux-kernel

On Mon, Mar 6, 2023 at 3:48 AM Dongliang Mu <dzm91@hust.edu.cn> wrote:
>
> From the comment of platform_get_irq, it only returns non-zero IRQ
> number and negative error number, other than zero.
>
> Fix this by removing the if condition.
>
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
>  drivers/i2c/busses/i2c-davinci.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
> index c836cf884185..9750310f2c96 100644
> --- a/drivers/i2c/busses/i2c-davinci.c
> +++ b/drivers/i2c/busses/i2c-davinci.c
> @@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
>         int r, irq;
>
>         irq = platform_get_irq(pdev, 0);
> -       if (irq <= 0) {
> -               if (!irq)
> -                       irq = -ENXIO;
> +       if (irq < 0)
>                 return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
> -       }
>
>         dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
>                         GFP_KERNEL);
> --
> 2.39.2
>

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

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

* Re: [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe
@ 2023-03-06  9:27   ` Bartosz Golaszewski
  0 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2023-03-06  9:27 UTC (permalink / raw)
  To: Dongliang Mu; +Cc: Sekhar Nori, linux-arm-kernel, linux-i2c, linux-kernel

On Mon, Mar 6, 2023 at 3:48 AM Dongliang Mu <dzm91@hust.edu.cn> wrote:
>
> From the comment of platform_get_irq, it only returns non-zero IRQ
> number and negative error number, other than zero.
>
> Fix this by removing the if condition.
>
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
>  drivers/i2c/busses/i2c-davinci.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
> index c836cf884185..9750310f2c96 100644
> --- a/drivers/i2c/busses/i2c-davinci.c
> +++ b/drivers/i2c/busses/i2c-davinci.c
> @@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
>         int r, irq;
>
>         irq = platform_get_irq(pdev, 0);
> -       if (irq <= 0) {
> -               if (!irq)
> -                       irq = -ENXIO;
> +       if (irq < 0)
>                 return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
> -       }
>
>         dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
>                         GFP_KERNEL);
> --
> 2.39.2
>

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe
  2023-03-06  2:45 ` Dongliang Mu
@ 2023-03-16 19:50   ` Wolfram Sang
  -1 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2023-03-16 19:50 UTC (permalink / raw)
  To: Dongliang Mu
  Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, linux-i2c,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

On Mon, Mar 06, 2023 at 10:45:23AM +0800, Dongliang Mu wrote:
> From the comment of platform_get_irq, it only returns non-zero IRQ
> number and negative error number, other than zero.
> 
> Fix this by removing the if condition.
> 
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe
@ 2023-03-16 19:50   ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2023-03-16 19:50 UTC (permalink / raw)
  To: Dongliang Mu
  Cc: Sekhar Nori, Bartosz Golaszewski, linux-arm-kernel, linux-i2c,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 322 bytes --]

On Mon, Mar 06, 2023 at 10:45:23AM +0800, Dongliang Mu wrote:
> From the comment of platform_get_irq, it only returns non-zero IRQ
> number and negative error number, other than zero.
> 
> Fix this by removing the if condition.
> 
> Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>

Applied to for-next, thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-03-16 19:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-06  2:45 [PATCH] drivers: i2c: remove dead code in davinci_i2c_probe Dongliang Mu
2023-03-06  2:45 ` Dongliang Mu
2023-03-06  9:27 ` Bartosz Golaszewski
2023-03-06  9:27   ` Bartosz Golaszewski
2023-03-16 19:50 ` Wolfram Sang
2023-03-16 19:50   ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.