* [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() [not found] <20190730181557.90391-1-swboyd@chromium.org> @ 2019-07-30 18:15 ` Stephen Boyd 2019-07-31 7:28 ` Bartosz Golaszewski 2019-08-05 11:26 ` Linus Walleij 2019-07-30 18:15 ` [PATCH v6 33/57] pinctrl: " Stephen Boyd 2019-07-30 18:15 ` [PATCH v6 34/57] pinctrl: intel: " Stephen Boyd 2 siblings, 2 replies; 8+ messages in thread From: Stephen Boyd @ 2019-07-30 18:15 UTC (permalink / raw) To: linux-kernel Cc: Linus Walleij, Bartosz Golaszewski, linux-gpio, Greg Kroah-Hartman We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: linux-gpio@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> --- Please apply directly to subsystem trees drivers/gpio/gpio-brcmstb.c | 4 +--- drivers/gpio/gpio-eic-sprd.c | 4 +--- drivers/gpio/gpio-grgpio.c | 2 -- drivers/gpio/gpio-max77620.c | 4 +--- drivers/gpio/gpio-pmic-eic-sprd.c | 4 +--- drivers/gpio/gpio-sprd.c | 4 +--- drivers/gpio/gpio-tb10x.c | 4 +--- drivers/gpio/gpio-tegra.c | 4 +--- drivers/gpio/gpio-zx.c | 1 - drivers/gpio/gpio-zynq.c | 4 +--- 10 files changed, 8 insertions(+), 27 deletions(-) diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index af936dcca659..05e3f99ae59c 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c @@ -636,10 +636,8 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) if (of_property_read_bool(np, "interrupt-controller")) { priv->parent_irq = platform_get_irq(pdev, 0); - if (priv->parent_irq <= 0) { - dev_err(dev, "Couldn't get IRQ"); + if (priv->parent_irq <= 0) return -ENOENT; - } } else { priv->parent_irq = -ENOENT; } diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index 7b9ac4a12c20..fe7a73f52329 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -584,10 +584,8 @@ static int sprd_eic_probe(struct platform_device *pdev) sprd_eic->type = pdata->type; sprd_eic->irq = platform_get_irq(pdev, 0); - if (sprd_eic->irq < 0) { - dev_err(&pdev->dev, "Failed to get EIC interrupt.\n"); + if (sprd_eic->irq < 0) return sprd_eic->irq; - } for (i = 0; i < SPRD_EIC_MAX_BANK; i++) { /* diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c index 0937b605e134..08234e64993a 100644 --- a/drivers/gpio/gpio-grgpio.c +++ b/drivers/gpio/gpio-grgpio.c @@ -408,8 +408,6 @@ static int grgpio_probe(struct platform_device *ofdev) * Continue without irq functionality for that * gpio line */ - dev_err(priv->dev, - "Failed to get irq for offset %d\n", i); continue; } priv->uirqs[lirq->index].uirq = ret; diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c index b7d89e30131e..47d05e357e61 100644 --- a/drivers/gpio/gpio-max77620.c +++ b/drivers/gpio/gpio-max77620.c @@ -270,10 +270,8 @@ static int max77620_gpio_probe(struct platform_device *pdev) int ret; gpio_irq = platform_get_irq(pdev, 0); - if (gpio_irq <= 0) { - dev_err(&pdev->dev, "GPIO irq not available %d\n", gpio_irq); + if (gpio_irq <= 0) return -ENODEV; - } mgpio = devm_kzalloc(&pdev->dev, sizeof(*mgpio), GFP_KERNEL); if (!mgpio) diff --git a/drivers/gpio/gpio-pmic-eic-sprd.c b/drivers/gpio/gpio-pmic-eic-sprd.c index 24228cf79afc..05000cace9b2 100644 --- a/drivers/gpio/gpio-pmic-eic-sprd.c +++ b/drivers/gpio/gpio-pmic-eic-sprd.c @@ -305,10 +305,8 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev) mutex_init(&pmic_eic->buslock); pmic_eic->irq = platform_get_irq(pdev, 0); - if (pmic_eic->irq < 0) { - dev_err(&pdev->dev, "Failed to get PMIC EIC interrupt.\n"); + if (pmic_eic->irq < 0) return pmic_eic->irq; - } pmic_eic->map = dev_get_regmap(pdev->dev.parent, NULL); if (!pmic_eic->map) diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c index f5c8b3a351d5..d7314d39ab65 100644 --- a/drivers/gpio/gpio-sprd.c +++ b/drivers/gpio/gpio-sprd.c @@ -226,10 +226,8 @@ static int sprd_gpio_probe(struct platform_device *pdev) return -ENOMEM; sprd_gpio->irq = platform_get_irq(pdev, 0); - if (sprd_gpio->irq < 0) { - dev_err(&pdev->dev, "Failed to get GPIO interrupt.\n"); + if (sprd_gpio->irq < 0) return sprd_gpio->irq; - } sprd_gpio->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(sprd_gpio->base)) diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c index bd1f3f775ce9..5e375186f90e 100644 --- a/drivers/gpio/gpio-tb10x.c +++ b/drivers/gpio/gpio-tb10x.c @@ -171,10 +171,8 @@ static int tb10x_gpio_probe(struct platform_device *pdev) struct irq_chip_generic *gc; ret = platform_get_irq(pdev, 0); - if (ret < 0) { - dev_err(dev, "No interrupt specified.\n"); + if (ret < 0) return ret; - } tb10x_gpio->gc.to_irq = tb10x_gpio_to_irq; tb10x_gpio->irq = ret; diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 0f59161a4701..8a01d3694b28 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -624,10 +624,8 @@ static int tegra_gpio_probe(struct platform_device *pdev) for (i = 0; i < tgi->bank_count; i++) { ret = platform_get_irq(pdev, i); - if (ret < 0) { - dev_err(&pdev->dev, "Missing IRQ resource: %d\n", ret); + if (ret < 0) return ret; - } bank = &tgi->bank_info[i]; bank->bank = i; diff --git a/drivers/gpio/gpio-zx.c b/drivers/gpio/gpio-zx.c index 8637adb6bc20..8d9b9bf8510a 100644 --- a/drivers/gpio/gpio-zx.c +++ b/drivers/gpio/gpio-zx.c @@ -253,7 +253,6 @@ static int zx_gpio_probe(struct platform_device *pdev) writew_relaxed(0, chip->base + ZX_GPIO_IE); irq = platform_get_irq(pdev, 0); if (irq < 0) { - dev_err(dev, "invalid IRQ\n"); gpiochip_remove(&chip->gc); return -ENODEV; } diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index f241b6c13dbe..86b0bd256c13 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -849,10 +849,8 @@ static int zynq_gpio_probe(struct platform_device *pdev) return PTR_ERR(gpio->base_addr); gpio->irq = platform_get_irq(pdev, 0); - if (gpio->irq < 0) { - dev_err(&pdev->dev, "invalid IRQ\n"); + if (gpio->irq < 0) return gpio->irq; - } /* configure the gpio chip */ chip = &gpio->chip; -- Sent by a computer through tubes ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() 2019-07-30 18:15 ` [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() Stephen Boyd @ 2019-07-31 7:28 ` Bartosz Golaszewski 2019-08-05 11:26 ` Linus Walleij 1 sibling, 0 replies; 8+ messages in thread From: Bartosz Golaszewski @ 2019-07-31 7:28 UTC (permalink / raw) To: Stephen Boyd; +Cc: LKML, Linus Walleij, linux-gpio, Greg Kroah-Hartman wt., 30 lip 2019 o 20:16 Stephen Boyd <swboyd@chromium.org> napisał(a): > > We don't need dev_err() messages when platform_get_irq() fails now that > platform_get_irq() prints an error message itself when something goes > wrong. Let's remove these prints with a simple semantic patch. > > // <smpl> > @@ > expression ret; > struct platform_device *E; > @@ > > ret = > ( > platform_get_irq(E, ...) > | > platform_get_irq_byname(E, ...) > ); > > if ( \( ret < 0 \| ret <= 0 \) ) > { > ( > -if (ret != -EPROBE_DEFER) > -{ ... > -dev_err(...); > -... } > | > ... > -dev_err(...); > ) > ... > } > // </smpl> > > While we're here, remove braces on if statements that only have one > statement (manually). > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> > Cc: linux-gpio@vger.kernel.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Stephen Boyd <swboyd@chromium.org> > --- > > Please apply directly to subsystem trees > > drivers/gpio/gpio-brcmstb.c | 4 +--- > drivers/gpio/gpio-eic-sprd.c | 4 +--- > drivers/gpio/gpio-grgpio.c | 2 -- > drivers/gpio/gpio-max77620.c | 4 +--- > drivers/gpio/gpio-pmic-eic-sprd.c | 4 +--- > drivers/gpio/gpio-sprd.c | 4 +--- > drivers/gpio/gpio-tb10x.c | 4 +--- > drivers/gpio/gpio-tegra.c | 4 +--- > drivers/gpio/gpio-zx.c | 1 - > drivers/gpio/gpio-zynq.c | 4 +--- > 10 files changed, 8 insertions(+), 27 deletions(-) > > diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c > index af936dcca659..05e3f99ae59c 100644 > --- a/drivers/gpio/gpio-brcmstb.c > +++ b/drivers/gpio/gpio-brcmstb.c > @@ -636,10 +636,8 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) > > if (of_property_read_bool(np, "interrupt-controller")) { > priv->parent_irq = platform_get_irq(pdev, 0); > - if (priv->parent_irq <= 0) { > - dev_err(dev, "Couldn't get IRQ"); > + if (priv->parent_irq <= 0) > return -ENOENT; > - } > } else { > priv->parent_irq = -ENOENT; > } > diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c > index 7b9ac4a12c20..fe7a73f52329 100644 > --- a/drivers/gpio/gpio-eic-sprd.c > +++ b/drivers/gpio/gpio-eic-sprd.c > @@ -584,10 +584,8 @@ static int sprd_eic_probe(struct platform_device *pdev) > sprd_eic->type = pdata->type; > > sprd_eic->irq = platform_get_irq(pdev, 0); > - if (sprd_eic->irq < 0) { > - dev_err(&pdev->dev, "Failed to get EIC interrupt.\n"); > + if (sprd_eic->irq < 0) > return sprd_eic->irq; > - } > > for (i = 0; i < SPRD_EIC_MAX_BANK; i++) { > /* > diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c > index 0937b605e134..08234e64993a 100644 > --- a/drivers/gpio/gpio-grgpio.c > +++ b/drivers/gpio/gpio-grgpio.c > @@ -408,8 +408,6 @@ static int grgpio_probe(struct platform_device *ofdev) > * Continue without irq functionality for that > * gpio line > */ > - dev_err(priv->dev, > - "Failed to get irq for offset %d\n", i); > continue; > } > priv->uirqs[lirq->index].uirq = ret; > diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c > index b7d89e30131e..47d05e357e61 100644 > --- a/drivers/gpio/gpio-max77620.c > +++ b/drivers/gpio/gpio-max77620.c > @@ -270,10 +270,8 @@ static int max77620_gpio_probe(struct platform_device *pdev) > int ret; > > gpio_irq = platform_get_irq(pdev, 0); > - if (gpio_irq <= 0) { > - dev_err(&pdev->dev, "GPIO irq not available %d\n", gpio_irq); > + if (gpio_irq <= 0) > return -ENODEV; > - } > > mgpio = devm_kzalloc(&pdev->dev, sizeof(*mgpio), GFP_KERNEL); > if (!mgpio) > diff --git a/drivers/gpio/gpio-pmic-eic-sprd.c b/drivers/gpio/gpio-pmic-eic-sprd.c > index 24228cf79afc..05000cace9b2 100644 > --- a/drivers/gpio/gpio-pmic-eic-sprd.c > +++ b/drivers/gpio/gpio-pmic-eic-sprd.c > @@ -305,10 +305,8 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev) > mutex_init(&pmic_eic->buslock); > > pmic_eic->irq = platform_get_irq(pdev, 0); > - if (pmic_eic->irq < 0) { > - dev_err(&pdev->dev, "Failed to get PMIC EIC interrupt.\n"); > + if (pmic_eic->irq < 0) > return pmic_eic->irq; > - } > > pmic_eic->map = dev_get_regmap(pdev->dev.parent, NULL); > if (!pmic_eic->map) > diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c > index f5c8b3a351d5..d7314d39ab65 100644 > --- a/drivers/gpio/gpio-sprd.c > +++ b/drivers/gpio/gpio-sprd.c > @@ -226,10 +226,8 @@ static int sprd_gpio_probe(struct platform_device *pdev) > return -ENOMEM; > > sprd_gpio->irq = platform_get_irq(pdev, 0); > - if (sprd_gpio->irq < 0) { > - dev_err(&pdev->dev, "Failed to get GPIO interrupt.\n"); > + if (sprd_gpio->irq < 0) > return sprd_gpio->irq; > - } > > sprd_gpio->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(sprd_gpio->base)) > diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c > index bd1f3f775ce9..5e375186f90e 100644 > --- a/drivers/gpio/gpio-tb10x.c > +++ b/drivers/gpio/gpio-tb10x.c > @@ -171,10 +171,8 @@ static int tb10x_gpio_probe(struct platform_device *pdev) > struct irq_chip_generic *gc; > > ret = platform_get_irq(pdev, 0); > - if (ret < 0) { > - dev_err(dev, "No interrupt specified.\n"); > + if (ret < 0) > return ret; > - } > > tb10x_gpio->gc.to_irq = tb10x_gpio_to_irq; > tb10x_gpio->irq = ret; > diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c > index 0f59161a4701..8a01d3694b28 100644 > --- a/drivers/gpio/gpio-tegra.c > +++ b/drivers/gpio/gpio-tegra.c > @@ -624,10 +624,8 @@ static int tegra_gpio_probe(struct platform_device *pdev) > > for (i = 0; i < tgi->bank_count; i++) { > ret = platform_get_irq(pdev, i); > - if (ret < 0) { > - dev_err(&pdev->dev, "Missing IRQ resource: %d\n", ret); > + if (ret < 0) > return ret; > - } > > bank = &tgi->bank_info[i]; > bank->bank = i; > diff --git a/drivers/gpio/gpio-zx.c b/drivers/gpio/gpio-zx.c > index 8637adb6bc20..8d9b9bf8510a 100644 > --- a/drivers/gpio/gpio-zx.c > +++ b/drivers/gpio/gpio-zx.c > @@ -253,7 +253,6 @@ static int zx_gpio_probe(struct platform_device *pdev) > writew_relaxed(0, chip->base + ZX_GPIO_IE); > irq = platform_get_irq(pdev, 0); > if (irq < 0) { > - dev_err(dev, "invalid IRQ\n"); > gpiochip_remove(&chip->gc); > return -ENODEV; > } > diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c > index f241b6c13dbe..86b0bd256c13 100644 > --- a/drivers/gpio/gpio-zynq.c > +++ b/drivers/gpio/gpio-zynq.c > @@ -849,10 +849,8 @@ static int zynq_gpio_probe(struct platform_device *pdev) > return PTR_ERR(gpio->base_addr); > > gpio->irq = platform_get_irq(pdev, 0); > - if (gpio->irq < 0) { > - dev_err(&pdev->dev, "invalid IRQ\n"); > + if (gpio->irq < 0) > return gpio->irq; > - } > > /* configure the gpio chip */ > chip = &gpio->chip; > -- > Sent by a computer through tubes > Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() 2019-07-30 18:15 ` [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() Stephen Boyd 2019-07-31 7:28 ` Bartosz Golaszewski @ 2019-08-05 11:26 ` Linus Walleij 1 sibling, 0 replies; 8+ messages in thread From: Linus Walleij @ 2019-08-05 11:26 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski, open list:GPIO SUBSYSTEM, Greg Kroah-Hartman On Tue, Jul 30, 2019 at 8:16 PM Stephen Boyd <swboyd@chromium.org> wrote: > We don't need dev_err() messages when platform_get_irq() fails now that > platform_get_irq() prints an error message itself when something goes > wrong. Let's remove these prints with a simple semantic patch. (...) > While we're here, remove braces on if statements that only have one > statement (manually). > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> > Cc: linux-gpio@vger.kernel.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Stephen Boyd <swboyd@chromium.org> Patch applied! Yours, Linus Walleij ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v6 33/57] pinctrl: Remove dev_err() usage after platform_get_irq() [not found] <20190730181557.90391-1-swboyd@chromium.org> 2019-07-30 18:15 ` [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() Stephen Boyd @ 2019-07-30 18:15 ` Stephen Boyd 2019-08-05 11:24 ` Linus Walleij 2019-07-30 18:15 ` [PATCH v6 34/57] pinctrl: intel: " Stephen Boyd 2 siblings, 1 reply; 8+ messages in thread From: Stephen Boyd @ 2019-07-30 18:15 UTC (permalink / raw) To: linux-kernel; +Cc: Linus Walleij, linux-gpio, Greg Kroah-Hartman We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-gpio@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> --- Please apply directly to subsystem trees drivers/pinctrl/pinctrl-amd.c | 4 +--- drivers/pinctrl/pinctrl-oxnas.c | 4 +--- drivers/pinctrl/pinctrl-pic32.c | 4 +--- drivers/pinctrl/pinctrl-stmfx.c | 4 +--- drivers/pinctrl/qcom/pinctrl-msm.c | 4 +--- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 5 +---- 6 files changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index 9b9c61e3f065..60d88e1df272 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c @@ -861,10 +861,8 @@ static int amd_gpio_probe(struct platform_device *pdev) return -ENOMEM; irq_base = platform_get_irq(pdev, 0); - if (irq_base < 0) { - dev_err(&pdev->dev, "Failed to get gpio IRQ: %d\n", irq_base); + if (irq_base < 0) return irq_base; - } #ifdef CONFIG_PM_SLEEP gpio_dev->saved_regs = devm_kcalloc(&pdev->dev, amd_pinctrl_desc.npins, diff --git a/drivers/pinctrl/pinctrl-oxnas.c b/drivers/pinctrl/pinctrl-oxnas.c index b4edbe0d9a73..4f6a196a663a 100644 --- a/drivers/pinctrl/pinctrl-oxnas.c +++ b/drivers/pinctrl/pinctrl-oxnas.c @@ -1229,10 +1229,8 @@ static int oxnas_gpio_probe(struct platform_device *pdev) return PTR_ERR(bank->reg_base); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "irq get failed\n"); + if (irq < 0) return irq; - } bank->id = id; bank->gpio_chip.parent = &pdev->dev; diff --git a/drivers/pinctrl/pinctrl-pic32.c b/drivers/pinctrl/pinctrl-pic32.c index 6dc98e22f9f5..e7f6dd5ab578 100644 --- a/drivers/pinctrl/pinctrl-pic32.c +++ b/drivers/pinctrl/pinctrl-pic32.c @@ -2222,10 +2222,8 @@ static int pic32_gpio_probe(struct platform_device *pdev) return PTR_ERR(bank->reg_base); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "irq get failed\n"); + if (irq < 0) return irq; - } bank->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(bank->clk)) { diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index d3332da35637..5735ef5a71d5 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -608,10 +608,8 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - dev_err(pctl->dev, "failed to get irq\n"); + if (irq <= 0) return -ENXIO; - } mutex_init(&pctl->lock); diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 7f35c196bb3e..45975ed31205 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -1160,10 +1160,8 @@ int msm_pinctrl_probe(struct platform_device *pdev, msm_pinctrl_setup_pm_reset(pctrl); pctrl->irq = platform_get_irq(pdev, 0); - if (pctrl->irq < 0) { - dev_err(&pdev->dev, "No interrupt defined for msmgpio\n"); + if (pctrl->irq < 0) return pctrl->irq; - } pctrl->desc.owner = THIS_MODULE; pctrl->desc.pctlops = &msm_pinctrl_ops; diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 076ba085a6a1..3d8b1d74fa2f 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -791,11 +791,8 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) for (i = 0; i < pctrl->desc.npins; i++) { pin_data[i].reg = SSBI_REG_ADDR_MPP(i); pin_data[i].irq = platform_get_irq(pdev, i); - if (pin_data[i].irq < 0) { - dev_err(&pdev->dev, - "missing interrupts for pin %d\n", i); + if (pin_data[i].irq < 0) return pin_data[i].irq; - } ret = pm8xxx_pin_populate(pctrl, &pin_data[i]); if (ret) -- Sent by a computer through tubes ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v6 33/57] pinctrl: Remove dev_err() usage after platform_get_irq() 2019-07-30 18:15 ` [PATCH v6 33/57] pinctrl: " Stephen Boyd @ 2019-08-05 11:24 ` Linus Walleij 0 siblings, 0 replies; 8+ messages in thread From: Linus Walleij @ 2019-08-05 11:24 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel@vger.kernel.org, open list:GPIO SUBSYSTEM, Greg Kroah-Hartman On Tue, Jul 30, 2019 at 8:16 PM Stephen Boyd <swboyd@chromium.org> wrote: > We don't need dev_err() messages when platform_get_irq() fails now that > platform_get_irq() prints an error message itself when something goes > wrong. Let's remove these prints with a simple semantic patch. (...) > While we're here, remove braces on if statements that only have one > statement (manually). > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: linux-gpio@vger.kernel.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Stephen Boyd <swboyd@chromium.org> Patch applied to the pinctrl tree! Nice work. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v6 34/57] pinctrl: intel: Remove dev_err() usage after platform_get_irq() [not found] <20190730181557.90391-1-swboyd@chromium.org> 2019-07-30 18:15 ` [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() Stephen Boyd 2019-07-30 18:15 ` [PATCH v6 33/57] pinctrl: " Stephen Boyd @ 2019-07-30 18:15 ` Stephen Boyd 2019-07-30 18:32 ` Andy Shevchenko 2019-08-01 13:57 ` Andy Shevchenko 2 siblings, 2 replies; 8+ messages in thread From: Stephen Boyd @ 2019-07-30 18:15 UTC (permalink / raw) To: linux-kernel Cc: Linus Walleij, linux-gpio, Greg Kroah-Hartman, Mika Westerberg, Andy Shevchenko We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-gpio@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Stephen Boyd <swboyd@chromium.org> --- Please apply directly to subsystem trees drivers/pinctrl/intel/pinctrl-cherryview.c | 4 +--- drivers/pinctrl/intel/pinctrl-intel.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 03ec7a5d9d0b..cd4a69b4c5a8 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1703,10 +1703,8 @@ static int chv_pinctrl_probe(struct platform_device *pdev) return PTR_ERR(pctrl->regs); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "failed to get interrupt number\n"); + if (irq < 0) return irq; - } pctrl->pctldesc = chv_pinctrl_desc; pctrl->pctldesc.name = dev_name(&pdev->dev); diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index a18d6eefe672..0487e8dc7654 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1354,10 +1354,8 @@ static int intel_pinctrl_probe(struct platform_device *pdev, } irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "failed to get interrupt number\n"); + if (irq < 0) return irq; - } ret = intel_pinctrl_pm_init(pctrl); if (ret) -- Sent by a computer through tubes ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v6 34/57] pinctrl: intel: Remove dev_err() usage after platform_get_irq() 2019-07-30 18:15 ` [PATCH v6 34/57] pinctrl: intel: " Stephen Boyd @ 2019-07-30 18:32 ` Andy Shevchenko 2019-08-01 13:57 ` Andy Shevchenko 1 sibling, 0 replies; 8+ messages in thread From: Andy Shevchenko @ 2019-07-30 18:32 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, Linus Walleij, linux-gpio, Greg Kroah-Hartman, Mika Westerberg On Tue, Jul 30, 2019 at 11:15:34AM -0700, Stephen Boyd wrote: > We don't need dev_err() messages when platform_get_irq() fails now that > platform_get_irq() prints an error message itself when something goes > wrong. Let's remove these prints with a simple semantic patch. > > // <smpl> > @@ > expression ret; > struct platform_device *E; > @@ > > ret = > ( > platform_get_irq(E, ...) > | > platform_get_irq_byname(E, ...) > ); > > if ( \( ret < 0 \| ret <= 0 \) ) > { > ( > -if (ret != -EPROBE_DEFER) > -{ ... > -dev_err(...); > -... } > | > ... > -dev_err(...); > ) > ... > } > // </smpl> > > While we're here, remove braces on if statements that only have one > statement (manually). Also, per file, but I will do it myself when applying, thanks! > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: linux-gpio@vger.kernel.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Signed-off-by: Stephen Boyd <swboyd@chromium.org> > --- > > Please apply directly to subsystem trees > > drivers/pinctrl/intel/pinctrl-cherryview.c | 4 +--- > drivers/pinctrl/intel/pinctrl-intel.c | 4 +--- > 2 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c > index 03ec7a5d9d0b..cd4a69b4c5a8 100644 > --- a/drivers/pinctrl/intel/pinctrl-cherryview.c > +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c > @@ -1703,10 +1703,8 @@ static int chv_pinctrl_probe(struct platform_device *pdev) > return PTR_ERR(pctrl->regs); > > irq = platform_get_irq(pdev, 0); > - if (irq < 0) { > - dev_err(&pdev->dev, "failed to get interrupt number\n"); > + if (irq < 0) > return irq; > - } > > pctrl->pctldesc = chv_pinctrl_desc; > pctrl->pctldesc.name = dev_name(&pdev->dev); > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c > index a18d6eefe672..0487e8dc7654 100644 > --- a/drivers/pinctrl/intel/pinctrl-intel.c > +++ b/drivers/pinctrl/intel/pinctrl-intel.c > @@ -1354,10 +1354,8 @@ static int intel_pinctrl_probe(struct platform_device *pdev, > } > > irq = platform_get_irq(pdev, 0); > - if (irq < 0) { > - dev_err(&pdev->dev, "failed to get interrupt number\n"); > + if (irq < 0) > return irq; > - } > > ret = intel_pinctrl_pm_init(pctrl); > if (ret) > -- > Sent by a computer through tubes > -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v6 34/57] pinctrl: intel: Remove dev_err() usage after platform_get_irq() 2019-07-30 18:15 ` [PATCH v6 34/57] pinctrl: intel: " Stephen Boyd 2019-07-30 18:32 ` Andy Shevchenko @ 2019-08-01 13:57 ` Andy Shevchenko 1 sibling, 0 replies; 8+ messages in thread From: Andy Shevchenko @ 2019-08-01 13:57 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, Linus Walleij, linux-gpio, Greg Kroah-Hartman, Mika Westerberg On Tue, Jul 30, 2019 at 11:15:34AM -0700, Stephen Boyd wrote: > We don't need dev_err() messages when platform_get_irq() fails now that > platform_get_irq() prints an error message itself when something goes > wrong. Let's remove these prints with a simple semantic patch. > > // <smpl> > @@ > expression ret; > struct platform_device *E; > @@ > > ret = > ( > platform_get_irq(E, ...) > | > platform_get_irq_byname(E, ...) > ); > > if ( \( ret < 0 \| ret <= 0 \) ) > { > ( > -if (ret != -EPROBE_DEFER) > -{ ... > -dev_err(...); > -... } > | > ... > -dev_err(...); > ) > ... > } > // </smpl> > > While we're here, remove braces on if statements that only have one > statement (manually). Pushed to my review and testing queue, thanks! > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: linux-gpio@vger.kernel.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com> > Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Signed-off-by: Stephen Boyd <swboyd@chromium.org> > --- > > Please apply directly to subsystem trees > > drivers/pinctrl/intel/pinctrl-cherryview.c | 4 +--- > drivers/pinctrl/intel/pinctrl-intel.c | 4 +--- > 2 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c > index 03ec7a5d9d0b..cd4a69b4c5a8 100644 > --- a/drivers/pinctrl/intel/pinctrl-cherryview.c > +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c > @@ -1703,10 +1703,8 @@ static int chv_pinctrl_probe(struct platform_device *pdev) > return PTR_ERR(pctrl->regs); > > irq = platform_get_irq(pdev, 0); > - if (irq < 0) { > - dev_err(&pdev->dev, "failed to get interrupt number\n"); > + if (irq < 0) > return irq; > - } > > pctrl->pctldesc = chv_pinctrl_desc; > pctrl->pctldesc.name = dev_name(&pdev->dev); > diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c > index a18d6eefe672..0487e8dc7654 100644 > --- a/drivers/pinctrl/intel/pinctrl-intel.c > +++ b/drivers/pinctrl/intel/pinctrl-intel.c > @@ -1354,10 +1354,8 @@ static int intel_pinctrl_probe(struct platform_device *pdev, > } > > irq = platform_get_irq(pdev, 0); > - if (irq < 0) { > - dev_err(&pdev->dev, "failed to get interrupt number\n"); > + if (irq < 0) > return irq; > - } > > ret = intel_pinctrl_pm_init(pctrl); > if (ret) > -- > Sent by a computer through tubes > -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-08-05 11:26 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20190730181557.90391-1-swboyd@chromium.org> 2019-07-30 18:15 ` [PATCH v6 15/57] gpio: Remove dev_err() usage after platform_get_irq() Stephen Boyd 2019-07-31 7:28 ` Bartosz Golaszewski 2019-08-05 11:26 ` Linus Walleij 2019-07-30 18:15 ` [PATCH v6 33/57] pinctrl: " Stephen Boyd 2019-08-05 11:24 ` Linus Walleij 2019-07-30 18:15 ` [PATCH v6 34/57] pinctrl: intel: " Stephen Boyd 2019-07-30 18:32 ` Andy Shevchenko 2019-08-01 13:57 ` Andy Shevchenko
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).