linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v3] gpio: omap: Remove redundant dev_err_probe() and zero value handle code
@ 2023-07-27 12:40 Ruan Jinjie
  2023-07-29 13:51 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Ruan Jinjie @ 2023-07-27 12:40 UTC (permalink / raw)
  To: linus.walleij, brgl, andy, grygorii.strashko, ssantosh, khilman,
	linux-gpio, linux-omap
  Cc: ruanjinjie

There is no need to call the dev_err_probe() function directly to print
a custom message when handling an error from platform_get_irq() function as
it is going to display an appropriate error message in case of a failure.

And the code to handle bank->irq = 0 is redundant because
platform_get_irq() do not return 0.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
---
v3:
- remove the redundant zero value handle code
---
v2:
- split into 2 patches on per-driver basis
---
 drivers/gpio/gpio-omap.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 2b78fde74e30..a927680c66f8 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1412,11 +1412,8 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	bank->dev = dev;
 
 	bank->irq = platform_get_irq(pdev, 0);
-	if (bank->irq <= 0) {
-		if (!bank->irq)
-			bank->irq = -ENXIO;
-		return dev_err_probe(dev, bank->irq, "can't get irq resource\n");
-	}
+	if (bank->irq < 0)
+		return bank->irq;
 
 	bank->chip.parent = dev;
 	bank->chip.owner = THIS_MODULE;
-- 
2.34.1


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

* Re: [PATCH -next v3] gpio: omap: Remove redundant dev_err_probe() and zero value handle code
  2023-07-27 12:40 [PATCH -next v3] gpio: omap: Remove redundant dev_err_probe() and zero value handle code Ruan Jinjie
@ 2023-07-29 13:51 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2023-07-29 13:51 UTC (permalink / raw)
  To: Ruan Jinjie
  Cc: linus.walleij, andy, grygorii.strashko, ssantosh, khilman,
	linux-gpio, linux-omap

On Thu, Jul 27, 2023 at 2:41 PM Ruan Jinjie <ruanjinjie@huawei.com> wrote:
>
> There is no need to call the dev_err_probe() function directly to print
> a custom message when handling an error from platform_get_irq() function as
> it is going to display an appropriate error message in case of a failure.
>
> And the code to handle bank->irq = 0 is redundant because
> platform_get_irq() do not return 0.
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> ---

Applied, thanks!

Bart

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

end of thread, other threads:[~2023-07-29 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 12:40 [PATCH -next v3] gpio: omap: Remove redundant dev_err_probe() and zero value handle code Ruan Jinjie
2023-07-29 13:51 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).