gpio: bcm-kona: Simplify with dev_err_probe()
Subsystems (7)
PATCH 1/6 gpio: bcm-kona: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value.
--- drivers/gpio/gpio-bcm-kona.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpio/gpio-bcm-kona.c +1 -4
@@ -590,10 +590,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)dev_err (dev,"Couldn't determine # GPIO banks\n" );return -ENOENT ; }else if (ret <0 ) { -if (ret != -EPROBE_DEFER ) -dev_err (dev,"Couldn't determine GPIO banks: (%pe)\n" , -ERR_PTR (ret)); -return ret; +return dev_err_probe (dev, ret,"Couldn't determine GPIO banks\n" ); } kona_gpio->num_bank = ret;
Signature · 1 line
2.17.1
PATCH 2/6 gpio: davinci: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value.
--- drivers/gpio/gpio-davinci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpio/gpio-davinci.c +2 -6
@@ -237,12 +237,8 @@ static int davinci_gpio_probe(struct platform_device *pdev)for (i =0 ; i < nirq; i++) { chips->irqs[i] =platform_get_irq (pdev, i); -if (chips->irqs[i] <0 ) { -if (chips->irqs[i] != -EPROBE_DEFER ) -dev_info (dev,"IRQ not populated, err = %d\n" , - chips->irqs[i]); -return chips->irqs[i]; - } +if (chips->irqs[i] <0 ) +return dev_err_probe (dev, chips->irqs[i],"IRQ not populated\n" ); } chips->chip.label =dev_name (dev);
Signature · 1 line
2.17.1
PATCH 3/6 gpio: omap: Simplify with dev_err_probe()
In reply to Krzysztof KozlowskiCommon pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value.
--- drivers/gpio/gpio-omap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpio/gpio-omap.c +1 -4
@@ -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;
Signature · 1 line
2.17.1
Re: [PATCH 3/6] gpio: omap: Simplify with dev_err_probe()
Quoted 15 lines · Krzysztof Kozlowski
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 <[email protected]>--- drivers/gpio/gpio-omap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpio/gpio-omap.c +0
-0@@ -1394,10 +1394,7 @@ static int omap_gpio_probe(struct platform_device *pdev)if (bank->irq <=0 ) {
drivers/gpio/gpio-omap.c static int omap_gpio_probe(struct platform_device *pdev) · line 1400
Quoted 10 lines
drivers/gpio/gpio-omap.c +1
-4if (!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;
Signature · 2 lines
Best regards, grygorii
PATCH 4/6 gpio: pca953x: Simplify with dev_err_probe()
In reply to Krzysztof KozlowskiCommon pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value.
--- drivers/gpio/gpio-pca953x.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpio/gpio-pca953x.c +3 -6
@@ -1000,12 +1000,9 @@ static int pca953x_probe(struct i2c_client *client, chip->client = client; reg =devm_regulator_get (&client->dev,"vcc" ); -if (IS_ERR (reg)) { - ret =PTR_ERR (reg); -if (ret != -EPROBE_DEFER ) -dev_err (&client->dev,"reg get err: %d\n" , ret); -return ret; - } +if (IS_ERR (reg)) +return dev_err_probe (&client->dev,PTR_ERR (reg),"reg get err\n" ); + ret =regulator_enable (reg);if (ret) {dev_err (&client->dev,"reg en err: %d\n" , ret);
Signature · 1 line
2.17.1
PATCH 5/6 gpio: pisosr: Simplify with dev_err_probe()
In reply to Krzysztof KozlowskiCommon pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value.
--- drivers/gpio/gpio-pisosr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpio/gpio-pisosr.c +3 -6
@@ -148,12 +148,9 @@ static int pisosr_gpio_probe(struct spi_device *spi)return -ENOMEM ; gpio->load_gpio =devm_gpiod_get_optional (dev,"load" ,GPIOD_OUT_LOW ); -if (IS_ERR (gpio->load_gpio)) { - ret =PTR_ERR (gpio->load_gpio); -if (ret != -EPROBE_DEFER ) -dev_err (dev,"Unable to allocate load GPIO\n" ); -return ret; - } +if (IS_ERR (gpio->load_gpio)) +return dev_err_probe (dev,PTR_ERR (gpio->load_gpio), +"Unable to allocate load GPIO\n" );mutex_init (&gpio->lock);
Signature · 1 line
2.17.1
PATCH 6/6 gpio: zynq: Simplify with dev_err_probe()
In reply to Krzysztof KozlowskiCommon pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value.
--- drivers/gpio/gpio-zynq.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpio/gpio-zynq.c +3 -5
@@ -929,11 +929,9 @@ static int zynq_gpio_probe(struct platform_device *pdev)/* Retrieve GPIO clock */ gpio->clk =devm_clk_get (&pdev->dev,NULL ); -if (IS_ERR (gpio->clk)) { -if (PTR_ERR (gpio->clk) != -EPROBE_DEFER ) -dev_err (&pdev->dev,"input clock not found.\n" ); -return PTR_ERR (gpio->clk); - } +if (IS_ERR (gpio->clk)) +return dev_err_probe (&pdev->dev,PTR_ERR (gpio->clk),"input clock not found.\n" ); + ret =clk_prepare_enable (gpio->clk);if (ret) {dev_err (&pdev->dev,"Unable to enable clock.\n" );
Signature · 1 line
2.17.1
Re: [PATCH 6/6] gpio: zynq: Simplify with dev_err_probe()
Quoted 18 lines · Krzysztof Kozlowski
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 <[email protected]>--- drivers/gpio/gpio-zynq.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpio/gpio-zynq.c +0
-1@@ -929,11 +929,9 @@ static int zynq_gpio_probe(struct platform_device *pdev)/* Retrieve GPIO clock */ gpio->clk =devm_clk_get (&pdev->dev,NULL ); -if (IS_ERR (gpio->clk)) {
drivers/gpio/gpio-zynq.c static int zynq_gpio_probe(struct platform_device *pdev) · line 937
Quoted 10 lines
drivers/gpio/gpio-zynq.c +3
-4-if (PTR_ERR (gpio->clk) != -EPROBE_DEFER ) -dev_err (&pdev->dev,"input clock not found.\n" ); -return PTR_ERR (gpio->clk); - } +if (IS_ERR (gpio->clk)) +return dev_err_probe (&pdev->dev,PTR_ERR (gpio->clk),"input clock not found.\n" ); + ret =clk_prepare_enable (gpio->clk);if (ret) {dev_err (&pdev->dev,"Unable to enable clock.\n" );
Thanks,
Michal
Re: [PATCH 6/6] gpio: zynq: Simplify with dev_err_probe()
In reply to Krzysztof KozlowskiQuoted 4 lines · Krzysztof Kozlowski
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 <[email protected]>
All six patches applied!
Thanks!
Yours,
Linus Walleij
Quoted 4 lines · Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
I believe you are doing this right (after we have discussed previous series and approaches).
for entire series (Linus!)
Quoted 24 lines
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/gpio/gpio-bcm-kona.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpio/gpio-bcm-kona.c +1
-5@@ -590,10 +590,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)dev_err (dev,"Couldn't determine # GPIO banks\n" );return -ENOENT ; }else if (ret <0 ) { -if (ret != -EPROBE_DEFER ) -dev_err (dev,"Couldn't determine GPIO banks: (%pe)\n" , -ERR_PTR (ret)); -return ret; +return dev_err_probe (dev, ret,"Couldn't determine GPIO banks\n" ); } kona_gpio->num_bank = ret; --2.17.1
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 4 lines · Krzysztof Kozlowski
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 <[email protected]>
Signature · 1 line
Florian
Bartosz Golaszewski
AppliedQuoted 26 lines · Krzysztof Kozlowski
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 <[email protected]>--- drivers/gpio/gpio-bcm-kona.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpio/gpio-bcm-kona.c +1
-5@@ -590,10 +590,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)dev_err (dev,"Couldn't determine # GPIO banks\n" );return -ENOENT ; }else if (ret <0 ) { -if (ret != -EPROBE_DEFER ) -dev_err (dev,"Couldn't determine GPIO banks: (%pe)\n" , -ERR_PTR (ret)); -return ret; +return dev_err_probe (dev, ret,"Couldn't determine GPIO banks\n" ); } kona_gpio->num_bank = ret; --
Quoted 2 lines
2.17.1
Queued the entire series with all the tags, thanks!
Bartosz
Quoted 1 line · Bartosz Golaszewski
Queued the entire series with all the tags, thanks!
Oh you already queued them, I'll drop them from my tree.
Thanks!
Linus Walleij