From 0bec8b7e5ca1a629f26173691526432f9d7cf8c1 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 14 Aug 2019 10:46:38 -0700 Subject: Input: remove dev_err() usage after platform_get_irq() 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. // @@ 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(...); ) ... } // While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd Signed-off-by: Dmitry Torokhov --- drivers/input/misc/88pm80x_onkey.c | 1 - drivers/input/misc/88pm860x_onkey.c | 4 +--- drivers/input/misc/ab8500-ponkey.c | 8 ++------ drivers/input/misc/axp20x-pek.c | 10 ++-------- drivers/input/misc/da9055_onkey.c | 5 +---- drivers/input/misc/da9063_onkey.c | 7 ++----- drivers/input/misc/e3x0-button.c | 10 ++-------- drivers/input/misc/hisi_powerkey.c | 8 ++------ drivers/input/misc/max8925_onkey.c | 8 ++------ drivers/input/misc/pm8941-pwrkey.c | 4 +--- drivers/input/misc/rk805-pwrkey.c | 8 ++------ drivers/input/misc/stpmic1_onkey.c | 10 ++-------- drivers/input/misc/tps65218-pwrbutton.c | 4 +--- drivers/input/misc/twl6040-vibra.c | 4 +--- 14 files changed, 21 insertions(+), 70 deletions(-) (limited to 'drivers/input/misc') diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c index 45a09497f680..51c8a326fd06 100644 --- a/drivers/input/misc/88pm80x_onkey.c +++ b/drivers/input/misc/88pm80x_onkey.c @@ -77,7 +77,6 @@ static int pm80x_onkey_probe(struct platform_device *pdev) info->irq = platform_get_irq(pdev, 0); if (info->irq < 0) { - dev_err(&pdev->dev, "No IRQ resource!\n"); err = -EINVAL; goto out; } diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c index cc87443aa2ee..685995cad73f 100644 --- a/drivers/input/misc/88pm860x_onkey.c +++ b/drivers/input/misc/88pm860x_onkey.c @@ -64,10 +64,8 @@ static int pm860x_onkey_probe(struct platform_device *pdev) int irq, ret; irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "No IRQ resource!\n"); + if (irq < 0) return -EINVAL; - } info = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_onkey_info), GFP_KERNEL); diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index 12b18a8db315..ea3b8292acdd 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c @@ -55,16 +55,12 @@ static int ab8500_ponkey_probe(struct platform_device *pdev) int error; irq_dbf = platform_get_irq_byname(pdev, "ONKEY_DBF"); - if (irq_dbf < 0) { - dev_err(&pdev->dev, "No IRQ for ONKEY_DBF, error=%d\n", irq_dbf); + if (irq_dbf < 0) return irq_dbf; - } irq_dbr = platform_get_irq_byname(pdev, "ONKEY_DBR"); - if (irq_dbr < 0) { - dev_err(&pdev->dev, "No IRQ for ONKEY_DBR, error=%d\n", irq_dbr); + if (irq_dbr < 0) return irq_dbr; - } ponkey = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_ponkey), GFP_KERNEL); diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c index 235925b28772..17c1cca74498 100644 --- a/drivers/input/misc/axp20x-pek.c +++ b/drivers/input/misc/axp20x-pek.c @@ -229,20 +229,14 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, int error; axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR"); - if (axp20x_pek->irq_dbr < 0) { - dev_err(&pdev->dev, "No IRQ for PEK_DBR, error=%d\n", - axp20x_pek->irq_dbr); + if (axp20x_pek->irq_dbr < 0) return axp20x_pek->irq_dbr; - } axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc, axp20x_pek->irq_dbr); axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF"); - if (axp20x_pek->irq_dbf < 0) { - dev_err(&pdev->dev, "No IRQ for PEK_DBF, error=%d\n", - axp20x_pek->irq_dbf); + if (axp20x_pek->irq_dbf < 0) return axp20x_pek->irq_dbf; - } axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc, axp20x_pek->irq_dbf); diff --git a/drivers/input/misc/da9055_onkey.c b/drivers/input/misc/da9055_onkey.c index a4ff4782e605..7a0d3a1d503c 100644 --- a/drivers/input/misc/da9055_onkey.c +++ b/drivers/input/misc/da9055_onkey.c @@ -76,11 +76,8 @@ static int da9055_onkey_probe(struct platform_device *pdev) int irq, err; irq = platform_get_irq_byname(pdev, "ONKEY"); - if (irq < 0) { - dev_err(&pdev->dev, - "Failed to get an IRQ for input device, %d\n", irq); + if (irq < 0) return -EINVAL; - } onkey = devm_kzalloc(&pdev->dev, sizeof(*onkey), GFP_KERNEL); if (!onkey) { diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c index fd355cf59397..dace8577fa43 100644 --- a/drivers/input/misc/da9063_onkey.c +++ b/drivers/input/misc/da9063_onkey.c @@ -248,11 +248,8 @@ static int da9063_onkey_probe(struct platform_device *pdev) } irq = platform_get_irq_byname(pdev, "ONKEY"); - if (irq < 0) { - error = irq; - dev_err(&pdev->dev, "Failed to get platform IRQ: %d\n", error); - return error; - } + if (irq < 0) + return irq; error = devm_request_threaded_irq(&pdev->dev, irq, NULL, da9063_onkey_irq_handler, diff --git a/drivers/input/misc/e3x0-button.c b/drivers/input/misc/e3x0-button.c index 4d7217f43888..e2fde6e1553f 100644 --- a/drivers/input/misc/e3x0-button.c +++ b/drivers/input/misc/e3x0-button.c @@ -65,18 +65,12 @@ static int e3x0_button_probe(struct platform_device *pdev) int error; irq_press = platform_get_irq_byname(pdev, "press"); - if (irq_press < 0) { - dev_err(&pdev->dev, "No IRQ for 'press', error=%d\n", - irq_press); + if (irq_press < 0) return irq_press; - } irq_release = platform_get_irq_byname(pdev, "release"); - if (irq_release < 0) { - dev_err(&pdev->dev, "No IRQ for 'release', error=%d\n", - irq_release); + if (irq_release < 0) return irq_release; - } input = devm_input_allocate_device(&pdev->dev); if (!input) diff --git a/drivers/input/misc/hisi_powerkey.c b/drivers/input/misc/hisi_powerkey.c index dee6245f38d7..d3c293a95d32 100644 --- a/drivers/input/misc/hisi_powerkey.c +++ b/drivers/input/misc/hisi_powerkey.c @@ -90,12 +90,8 @@ static int hi65xx_powerkey_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(hi65xx_irq_info); i++) { irq = platform_get_irq_byname(pdev, hi65xx_irq_info[i].name); - if (irq < 0) { - error = irq; - dev_err(dev, "couldn't get irq %s: %d\n", - hi65xx_irq_info[i].name, error); - return error; - } + if (irq < 0) + return irq; error = devm_request_any_context_irq(dev, irq, hi65xx_irq_info[i].handler, diff --git a/drivers/input/misc/max8925_onkey.c b/drivers/input/misc/max8925_onkey.c index 7c49b8d23894..ffab4a490c75 100644 --- a/drivers/input/misc/max8925_onkey.c +++ b/drivers/input/misc/max8925_onkey.c @@ -71,16 +71,12 @@ static int max8925_onkey_probe(struct platform_device *pdev) int irq[2], error; irq[0] = platform_get_irq(pdev, 0); - if (irq[0] < 0) { - dev_err(&pdev->dev, "No IRQ resource!\n"); + if (irq[0] < 0) return -EINVAL; - } irq[1] = platform_get_irq(pdev, 1); - if (irq[1] < 0) { - dev_err(&pdev->dev, "No IRQ resource!\n"); + if (irq[1] < 0) return -EINVAL; - } info = devm_kzalloc(&pdev->dev, sizeof(struct max8925_onkey_info), GFP_KERNEL); diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index 017f81a66658..cf8104454e74 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -205,10 +205,8 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) return error; pwrkey->irq = platform_get_irq(pdev, 0); - if (pwrkey->irq < 0) { - dev_err(&pdev->dev, "failed to get irq\n"); + if (pwrkey->irq < 0) return pwrkey->irq; - } error = regmap_read(pwrkey->regmap, pwrkey->baseaddr + PON_REV2, &pwrkey->revision); diff --git a/drivers/input/misc/rk805-pwrkey.c b/drivers/input/misc/rk805-pwrkey.c index 4a6d4a5746e5..3fb64dbda1a2 100644 --- a/drivers/input/misc/rk805-pwrkey.c +++ b/drivers/input/misc/rk805-pwrkey.c @@ -53,16 +53,12 @@ static int rk805_pwrkey_probe(struct platform_device *pdev) input_set_capability(pwr, EV_KEY, KEY_POWER); fall_irq = platform_get_irq(pdev, 0); - if (fall_irq < 0) { - dev_err(&pdev->dev, "Can't get fall irq: %d\n", fall_irq); + if (fall_irq < 0) return fall_irq; - } rise_irq = platform_get_irq(pdev, 1); - if (rise_irq < 0) { - dev_err(&pdev->dev, "Can't get rise irq: %d\n", rise_irq); + if (rise_irq < 0) return rise_irq; - } err = devm_request_any_context_irq(&pwr->dev, fall_irq, pwrkey_fall_irq, diff --git a/drivers/input/misc/stpmic1_onkey.c b/drivers/input/misc/stpmic1_onkey.c index 7b49c9997df7..d8dc2f2f8000 100644 --- a/drivers/input/misc/stpmic1_onkey.c +++ b/drivers/input/misc/stpmic1_onkey.c @@ -61,18 +61,12 @@ static int stpmic1_onkey_probe(struct platform_device *pdev) return -ENOMEM; onkey->irq_falling = platform_get_irq_byname(pdev, "onkey-falling"); - if (onkey->irq_falling < 0) { - dev_err(dev, "failed: request IRQ onkey-falling %d\n", - onkey->irq_falling); + if (onkey->irq_falling < 0) return onkey->irq_falling; - } onkey->irq_rising = platform_get_irq_byname(pdev, "onkey-rising"); - if (onkey->irq_rising < 0) { - dev_err(dev, "failed: request IRQ onkey-rising %d\n", - onkey->irq_rising); + if (onkey->irq_rising < 0) return onkey->irq_rising; - } if (!device_property_read_u32(dev, "power-off-time-sec", &val)) { if (val > 0 && val <= 16) { diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c index a4455bb12ae0..f011447c44fb 100644 --- a/drivers/input/misc/tps65218-pwrbutton.c +++ b/drivers/input/misc/tps65218-pwrbutton.c @@ -124,10 +124,8 @@ static int tps6521x_pb_probe(struct platform_device *pdev) device_init_wakeup(dev, true); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(dev, "No IRQ resource!\n"); + if (irq < 0) return -EINVAL; - } error = devm_request_threaded_irq(dev, irq, NULL, tps6521x_pb_irq, IRQF_TRIGGER_RISING | diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 93235a007d07..bf6644927630 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c @@ -272,10 +272,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev) } info->irq = platform_get_irq(pdev, 0); - if (info->irq < 0) { - dev_err(info->dev, "invalid irq\n"); + if (info->irq < 0) return -EINVAL; - } error = devm_request_threaded_irq(&pdev->dev, info->irq, NULL, twl6040_vib_irq_handler, -- cgit v1.2.3