Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

// <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).

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Stephen Boyd and committed by
Dmitry Torokhov
0bec8b7e f5d4c647

+44 -142
+1 -3
drivers/input/keyboard/bcm-keypad.c
··· 413 413 bcm_kp_stop(kp); 414 414 415 415 kp->irq = platform_get_irq(pdev, 0); 416 - if (kp->irq < 0) { 417 - dev_err(&pdev->dev, "no IRQ specified\n"); 416 + if (kp->irq < 0) 418 417 return -EINVAL; 419 - } 420 418 421 419 error = devm_request_threaded_irq(&pdev->dev, kp->irq, 422 420 NULL, bcm_kp_isr_thread,
-1
drivers/input/keyboard/davinci_keyscan.c
··· 192 192 193 193 davinci_ks->irq = platform_get_irq(pdev, 0); 194 194 if (davinci_ks->irq < 0) { 195 - dev_err(dev, "no key scan irq\n"); 196 195 error = davinci_ks->irq; 197 196 goto fail2; 198 197 }
+1 -3
drivers/input/keyboard/imx_keypad.c
··· 430 430 } 431 431 432 432 irq = platform_get_irq(pdev, 0); 433 - if (irq < 0) { 434 - dev_err(&pdev->dev, "no irq defined in platform data\n"); 433 + if (irq < 0) 435 434 return irq; 436 - } 437 435 438 436 input_dev = devm_input_allocate_device(&pdev->dev); 439 437 if (!input_dev) {
+1 -3
drivers/input/keyboard/lpc32xx-keys.c
··· 172 172 } 173 173 174 174 irq = platform_get_irq(pdev, 0); 175 - if (irq < 0) { 176 - dev_err(&pdev->dev, "failed to get platform irq\n"); 175 + if (irq < 0) 177 176 return -EINVAL; 178 - } 179 177 180 178 kscandat = devm_kzalloc(&pdev->dev, sizeof(*kscandat), 181 179 GFP_KERNEL);
+1 -3
drivers/input/keyboard/nomadik-ske-keypad.c
··· 235 235 } 236 236 237 237 irq = platform_get_irq(pdev, 0); 238 - if (irq < 0) { 239 - dev_err(&pdev->dev, "failed to get keypad irq\n"); 238 + if (irq < 0) 240 239 return -EINVAL; 241 - } 242 240 243 241 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 244 242 if (!res) {
+1 -3
drivers/input/keyboard/nspire-keypad.c
··· 165 165 int error; 166 166 167 167 irq = platform_get_irq(pdev, 0); 168 - if (irq < 0) { 169 - dev_err(&pdev->dev, "failed to get keypad irq\n"); 168 + if (irq < 0) 170 169 return -EINVAL; 171 - } 172 170 173 171 keypad = devm_kzalloc(&pdev->dev, sizeof(struct nspire_keypad), 174 172 GFP_KERNEL);
+1 -3
drivers/input/keyboard/opencores-kbd.c
··· 49 49 } 50 50 51 51 irq = platform_get_irq(pdev, 0); 52 - if (irq < 0) { 53 - dev_err(&pdev->dev, "missing board IRQ resource\n"); 52 + if (irq < 0) 54 53 return -EINVAL; 55 - } 56 54 57 55 opencores_kbd = devm_kzalloc(&pdev->dev, sizeof(*opencores_kbd), 58 56 GFP_KERNEL);
+2 -6
drivers/input/keyboard/pmic8xxx-keypad.c
··· 544 544 } 545 545 546 546 kp->key_sense_irq = platform_get_irq(pdev, 0); 547 - if (kp->key_sense_irq < 0) { 548 - dev_err(&pdev->dev, "unable to get keypad sense irq\n"); 547 + if (kp->key_sense_irq < 0) 549 548 return kp->key_sense_irq; 550 - } 551 549 552 550 kp->key_stuck_irq = platform_get_irq(pdev, 1); 553 - if (kp->key_stuck_irq < 0) { 554 - dev_err(&pdev->dev, "unable to get keypad stuck irq\n"); 551 + if (kp->key_stuck_irq < 0) 555 552 return kp->key_stuck_irq; 556 - } 557 553 558 554 kp->input->name = "PMIC8XXX keypad"; 559 555 kp->input->phys = "pmic8xxx_keypad/input0";
+1 -3
drivers/input/keyboard/pxa27x_keypad.c
··· 727 727 return -EINVAL; 728 728 729 729 irq = platform_get_irq(pdev, 0); 730 - if (irq < 0) { 731 - dev_err(&pdev->dev, "failed to get keypad irq\n"); 730 + if (irq < 0) 732 731 return -ENXIO; 733 - } 734 732 735 733 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 736 734 if (res == NULL) {
+1 -3
drivers/input/keyboard/pxa930_rotary.c
··· 89 89 int err; 90 90 91 91 irq = platform_get_irq(pdev, 0); 92 - if (irq < 0) { 93 - dev_err(&pdev->dev, "no irq for rotary controller\n"); 92 + if (irq < 0) 94 93 return -ENXIO; 95 - } 96 94 97 95 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 98 96 if (!res) {
+1 -3
drivers/input/keyboard/sh_keysc.c
··· 181 181 } 182 182 183 183 irq = platform_get_irq(pdev, 0); 184 - if (irq < 0) { 185 - dev_err(&pdev->dev, "failed to get irq\n"); 184 + if (irq < 0) 186 185 goto err0; 187 - } 188 186 189 187 priv = kzalloc(sizeof(*priv), GFP_KERNEL); 190 188 if (priv == NULL) {
+1 -3
drivers/input/keyboard/snvs_pwrkey.c
··· 118 118 pdata->wakeup = of_property_read_bool(np, "wakeup-source"); 119 119 120 120 pdata->irq = platform_get_irq(pdev, 0); 121 - if (pdata->irq < 0) { 122 - dev_err(&pdev->dev, "no irq defined in platform data\n"); 121 + if (pdata->irq < 0) 123 122 return -EINVAL; 124 - } 125 123 126 124 regmap_update_bits(pdata->snvs, SNVS_LPCR_REG, SNVS_LPCR_DEP_EN, SNVS_LPCR_DEP_EN); 127 125
+1 -3
drivers/input/keyboard/spear-keyboard.c
··· 191 191 int error; 192 192 193 193 irq = platform_get_irq(pdev, 0); 194 - if (irq < 0) { 195 - dev_err(&pdev->dev, "not able to get irq for the device\n"); 194 + if (irq < 0) 196 195 return irq; 197 - } 198 196 199 197 kbd = devm_kzalloc(&pdev->dev, sizeof(*kbd), GFP_KERNEL); 200 198 if (!kbd) {
+1 -3
drivers/input/keyboard/st-keyscan.c
··· 187 187 keyscan_stop(keypad_data); 188 188 189 189 keypad_data->irq = platform_get_irq(pdev, 0); 190 - if (keypad_data->irq < 0) { 191 - dev_err(&pdev->dev, "no IRQ specified\n"); 190 + if (keypad_data->irq < 0) 192 191 return -EINVAL; 193 - } 194 192 195 193 error = devm_request_irq(&pdev->dev, keypad_data->irq, keyscan_isr, 0, 196 194 pdev->name, keypad_data);
+1 -3
drivers/input/keyboard/tegra-kbc.c
··· 631 631 return -EINVAL; 632 632 633 633 kbc->irq = platform_get_irq(pdev, 0); 634 - if (kbc->irq < 0) { 635 - dev_err(&pdev->dev, "failed to get keyboard IRQ\n"); 634 + if (kbc->irq < 0) 636 635 return -ENXIO; 637 - } 638 636 639 637 kbc->idev = devm_input_allocate_device(&pdev->dev); 640 638 if (!kbc->idev) {
-1
drivers/input/misc/88pm80x_onkey.c
··· 77 77 78 78 info->irq = platform_get_irq(pdev, 0); 79 79 if (info->irq < 0) { 80 - dev_err(&pdev->dev, "No IRQ resource!\n"); 81 80 err = -EINVAL; 82 81 goto out; 83 82 }
+1 -3
drivers/input/misc/88pm860x_onkey.c
··· 64 64 int irq, ret; 65 65 66 66 irq = platform_get_irq(pdev, 0); 67 - if (irq < 0) { 68 - dev_err(&pdev->dev, "No IRQ resource!\n"); 67 + if (irq < 0) 69 68 return -EINVAL; 70 - } 71 69 72 70 info = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_onkey_info), 73 71 GFP_KERNEL);
+2 -6
drivers/input/misc/ab8500-ponkey.c
··· 55 55 int error; 56 56 57 57 irq_dbf = platform_get_irq_byname(pdev, "ONKEY_DBF"); 58 - if (irq_dbf < 0) { 59 - dev_err(&pdev->dev, "No IRQ for ONKEY_DBF, error=%d\n", irq_dbf); 58 + if (irq_dbf < 0) 60 59 return irq_dbf; 61 - } 62 60 63 61 irq_dbr = platform_get_irq_byname(pdev, "ONKEY_DBR"); 64 - if (irq_dbr < 0) { 65 - dev_err(&pdev->dev, "No IRQ for ONKEY_DBR, error=%d\n", irq_dbr); 62 + if (irq_dbr < 0) 66 63 return irq_dbr; 67 - } 68 64 69 65 ponkey = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_ponkey), 70 66 GFP_KERNEL);
+2 -8
drivers/input/misc/axp20x-pek.c
··· 229 229 int error; 230 230 231 231 axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR"); 232 - if (axp20x_pek->irq_dbr < 0) { 233 - dev_err(&pdev->dev, "No IRQ for PEK_DBR, error=%d\n", 234 - axp20x_pek->irq_dbr); 232 + if (axp20x_pek->irq_dbr < 0) 235 233 return axp20x_pek->irq_dbr; 236 - } 237 234 axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc, 238 235 axp20x_pek->irq_dbr); 239 236 240 237 axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF"); 241 - if (axp20x_pek->irq_dbf < 0) { 242 - dev_err(&pdev->dev, "No IRQ for PEK_DBF, error=%d\n", 243 - axp20x_pek->irq_dbf); 238 + if (axp20x_pek->irq_dbf < 0) 244 239 return axp20x_pek->irq_dbf; 245 - } 246 240 axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc, 247 241 axp20x_pek->irq_dbf); 248 242
+1 -4
drivers/input/misc/da9055_onkey.c
··· 76 76 int irq, err; 77 77 78 78 irq = platform_get_irq_byname(pdev, "ONKEY"); 79 - if (irq < 0) { 80 - dev_err(&pdev->dev, 81 - "Failed to get an IRQ for input device, %d\n", irq); 79 + if (irq < 0) 82 80 return -EINVAL; 83 - } 84 81 85 82 onkey = devm_kzalloc(&pdev->dev, sizeof(*onkey), GFP_KERNEL); 86 83 if (!onkey) {
+2 -5
drivers/input/misc/da9063_onkey.c
··· 248 248 } 249 249 250 250 irq = platform_get_irq_byname(pdev, "ONKEY"); 251 - if (irq < 0) { 252 - error = irq; 253 - dev_err(&pdev->dev, "Failed to get platform IRQ: %d\n", error); 254 - return error; 255 - } 251 + if (irq < 0) 252 + return irq; 256 253 257 254 error = devm_request_threaded_irq(&pdev->dev, irq, 258 255 NULL, da9063_onkey_irq_handler,
+2 -8
drivers/input/misc/e3x0-button.c
··· 65 65 int error; 66 66 67 67 irq_press = platform_get_irq_byname(pdev, "press"); 68 - if (irq_press < 0) { 69 - dev_err(&pdev->dev, "No IRQ for 'press', error=%d\n", 70 - irq_press); 68 + if (irq_press < 0) 71 69 return irq_press; 72 - } 73 70 74 71 irq_release = platform_get_irq_byname(pdev, "release"); 75 - if (irq_release < 0) { 76 - dev_err(&pdev->dev, "No IRQ for 'release', error=%d\n", 77 - irq_release); 72 + if (irq_release < 0) 78 73 return irq_release; 79 - } 80 74 81 75 input = devm_input_allocate_device(&pdev->dev); 82 76 if (!input)
+2 -6
drivers/input/misc/hisi_powerkey.c
··· 90 90 for (i = 0; i < ARRAY_SIZE(hi65xx_irq_info); i++) { 91 91 92 92 irq = platform_get_irq_byname(pdev, hi65xx_irq_info[i].name); 93 - if (irq < 0) { 94 - error = irq; 95 - dev_err(dev, "couldn't get irq %s: %d\n", 96 - hi65xx_irq_info[i].name, error); 97 - return error; 98 - } 93 + if (irq < 0) 94 + return irq; 99 95 100 96 error = devm_request_any_context_irq(dev, irq, 101 97 hi65xx_irq_info[i].handler,
+2 -6
drivers/input/misc/max8925_onkey.c
··· 71 71 int irq[2], error; 72 72 73 73 irq[0] = platform_get_irq(pdev, 0); 74 - if (irq[0] < 0) { 75 - dev_err(&pdev->dev, "No IRQ resource!\n"); 74 + if (irq[0] < 0) 76 75 return -EINVAL; 77 - } 78 76 79 77 irq[1] = platform_get_irq(pdev, 1); 80 - if (irq[1] < 0) { 81 - dev_err(&pdev->dev, "No IRQ resource!\n"); 78 + if (irq[1] < 0) 82 79 return -EINVAL; 83 - } 84 80 85 81 info = devm_kzalloc(&pdev->dev, sizeof(struct max8925_onkey_info), 86 82 GFP_KERNEL);
+1 -3
drivers/input/misc/pm8941-pwrkey.c
··· 205 205 return error; 206 206 207 207 pwrkey->irq = platform_get_irq(pdev, 0); 208 - if (pwrkey->irq < 0) { 209 - dev_err(&pdev->dev, "failed to get irq\n"); 208 + if (pwrkey->irq < 0) 210 209 return pwrkey->irq; 211 - } 212 210 213 211 error = regmap_read(pwrkey->regmap, pwrkey->baseaddr + PON_REV2, 214 212 &pwrkey->revision);
+2 -6
drivers/input/misc/rk805-pwrkey.c
··· 53 53 input_set_capability(pwr, EV_KEY, KEY_POWER); 54 54 55 55 fall_irq = platform_get_irq(pdev, 0); 56 - if (fall_irq < 0) { 57 - dev_err(&pdev->dev, "Can't get fall irq: %d\n", fall_irq); 56 + if (fall_irq < 0) 58 57 return fall_irq; 59 - } 60 58 61 59 rise_irq = platform_get_irq(pdev, 1); 62 - if (rise_irq < 0) { 63 - dev_err(&pdev->dev, "Can't get rise irq: %d\n", rise_irq); 60 + if (rise_irq < 0) 64 61 return rise_irq; 65 - } 66 62 67 63 err = devm_request_any_context_irq(&pwr->dev, fall_irq, 68 64 pwrkey_fall_irq,
+2 -8
drivers/input/misc/stpmic1_onkey.c
··· 61 61 return -ENOMEM; 62 62 63 63 onkey->irq_falling = platform_get_irq_byname(pdev, "onkey-falling"); 64 - if (onkey->irq_falling < 0) { 65 - dev_err(dev, "failed: request IRQ onkey-falling %d\n", 66 - onkey->irq_falling); 64 + if (onkey->irq_falling < 0) 67 65 return onkey->irq_falling; 68 - } 69 66 70 67 onkey->irq_rising = platform_get_irq_byname(pdev, "onkey-rising"); 71 - if (onkey->irq_rising < 0) { 72 - dev_err(dev, "failed: request IRQ onkey-rising %d\n", 73 - onkey->irq_rising); 68 + if (onkey->irq_rising < 0) 74 69 return onkey->irq_rising; 75 - } 76 70 77 71 if (!device_property_read_u32(dev, "power-off-time-sec", &val)) { 78 72 if (val > 0 && val <= 16) {
+1 -3
drivers/input/misc/tps65218-pwrbutton.c
··· 124 124 device_init_wakeup(dev, true); 125 125 126 126 irq = platform_get_irq(pdev, 0); 127 - if (irq < 0) { 128 - dev_err(dev, "No IRQ resource!\n"); 127 + if (irq < 0) 129 128 return -EINVAL; 130 - } 131 129 132 130 error = devm_request_threaded_irq(dev, irq, NULL, tps6521x_pb_irq, 133 131 IRQF_TRIGGER_RISING |
+1 -3
drivers/input/misc/twl6040-vibra.c
··· 272 272 } 273 273 274 274 info->irq = platform_get_irq(pdev, 0); 275 - if (info->irq < 0) { 276 - dev_err(info->dev, "invalid irq\n"); 275 + if (info->irq < 0) 277 276 return -EINVAL; 278 - } 279 277 280 278 error = devm_request_threaded_irq(&pdev->dev, info->irq, NULL, 281 279 twl6040_vib_irq_handler,
+1 -3
drivers/input/mouse/pxa930_trkball.c
··· 147 147 int irq, error; 148 148 149 149 irq = platform_get_irq(pdev, 0); 150 - if (irq < 0) { 151 - dev_err(&pdev->dev, "failed to get trkball irq\n"); 150 + if (irq < 0) 152 151 return -ENXIO; 153 - } 154 152 155 153 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 156 154 if (!res) {
+1 -3
drivers/input/serio/arc_ps2.c
··· 187 187 int error, id, i; 188 188 189 189 irq = platform_get_irq_byname(pdev, "arc_ps2_irq"); 190 - if (irq < 0) { 191 - dev_err(&pdev->dev, "no IRQ defined\n"); 190 + if (irq < 0) 192 191 return -EINVAL; 193 - } 194 192 195 193 arc_ps2 = devm_kzalloc(&pdev->dev, sizeof(struct arc_ps2_data), 196 194 GFP_KERNEL);
-2
drivers/input/serio/ps2-gpio.c
··· 369 369 370 370 drvdata->irq = platform_get_irq(pdev, 0); 371 371 if (drvdata->irq < 0) { 372 - dev_err(dev, "failed to get irq from platform resource: %d\n", 373 - drvdata->irq); 374 372 error = drvdata->irq; 375 373 goto err_free_serio; 376 374 }
+1 -3
drivers/input/touchscreen/88pm860x-ts.c
··· 185 185 int irq, ret, res_x = 0, data = 0; 186 186 187 187 irq = platform_get_irq(pdev, 0); 188 - if (irq < 0) { 189 - dev_err(&pdev->dev, "No IRQ resource!\n"); 188 + if (irq < 0) 190 189 return -EINVAL; 191 - } 192 190 193 191 if (pm860x_touch_dt_init(pdev, chip, &res_x)) { 194 192 if (pdata) {
+1 -3
drivers/input/touchscreen/bcm_iproc_tsc.c
··· 489 489 490 490 /* get interrupt */ 491 491 irq = platform_get_irq(pdev, 0); 492 - if (irq < 0) { 493 - dev_err(&pdev->dev, "platform_get_irq failed: %d\n", irq); 492 + if (irq < 0) 494 493 return irq; 495 - } 496 494 497 495 error = devm_request_irq(&pdev->dev, irq, 498 496 iproc_touchscreen_interrupt,
+1 -3
drivers/input/touchscreen/fsl-imx25-tcq.c
··· 526 526 } 527 527 528 528 priv->irq = platform_get_irq(pdev, 0); 529 - if (priv->irq <= 0) { 530 - dev_err(dev, "Failed to get IRQ\n"); 529 + if (priv->irq <= 0) 531 530 return priv->irq; 532 - } 533 531 534 532 idev = devm_input_allocate_device(dev); 535 533 if (!idev) {
+2 -6
drivers/input/touchscreen/imx6ul_tsc.c
··· 430 430 } 431 431 432 432 tsc_irq = platform_get_irq(pdev, 0); 433 - if (tsc_irq < 0) { 434 - dev_err(&pdev->dev, "no tsc irq resource?\n"); 433 + if (tsc_irq < 0) 435 434 return tsc_irq; 436 - } 437 435 438 436 adc_irq = platform_get_irq(pdev, 1); 439 - if (adc_irq < 0) { 440 - dev_err(&pdev->dev, "no adc irq resource?\n"); 437 + if (adc_irq < 0) 441 438 return adc_irq; 442 - } 443 439 444 440 err = devm_request_threaded_irq(tsc->dev, tsc_irq, 445 441 NULL, tsc_irq_fn, IRQF_ONESHOT,
+1 -3
drivers/input/touchscreen/lpc32xx_ts.c
··· 212 212 } 213 213 214 214 irq = platform_get_irq(pdev, 0); 215 - if (irq < 0) { 216 - dev_err(&pdev->dev, "Can't get interrupt resource\n"); 215 + if (irq < 0) 217 216 return irq; 218 - } 219 217 220 218 tsc = kzalloc(sizeof(*tsc), GFP_KERNEL); 221 219 input = input_allocate_device();