diff mbox series

[3/6] gpio: omap: Simplify with dev_err_probe()

Message ID 20200827200827.26462-3-krzk@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/6] gpio: bcm-kona: Simplify with dev_err_probe() | expand

Commit Message

Krzysztof Kozlowski Aug. 27, 2020, 8:08 p.m. UTC
Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/gpio/gpio-omap.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Grygorii Strashko Aug. 28, 2020, 8:01 a.m. UTC | #1
On 27/08/2020 23:08, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>   drivers/gpio/gpio-omap.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 7fbe0c9e1fc1..2dc12f4addbd 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1394,10 +1394,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
>   	if (bank->irq <= 0) {
>   		if (!bank->irq)
>   			bank->irq = -ENXIO;
> -		if (bank->irq != -EPROBE_DEFER)
> -			dev_err(dev,
> -				"can't get irq resource ret=%d\n", bank->irq);
> -		return bank->irq;
> +		return dev_err_probe(dev, bank->irq, "can't get irq resource\n");
>   	}
>   
>   	bank->chip.parent = dev;
> 

Acked-by: Grygorii Strashko <grygorii.strashko@ti.com>
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 7fbe0c9e1fc1..2dc12f4addbd 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1394,10 +1394,7 @@  static int omap_gpio_probe(struct platform_device *pdev)
 	if (bank->irq <= 0) {
 		if (!bank->irq)
 			bank->irq = -ENXIO;
-		if (bank->irq != -EPROBE_DEFER)
-			dev_err(dev,
-				"can't get irq resource ret=%d\n", bank->irq);
-		return bank->irq;
+		return dev_err_probe(dev, bank->irq, "can't get irq resource\n");
 	}
 
 	bank->chip.parent = dev;