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

mfd: Kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Rob Herring and committed by
Lee Jones
9bd09f34 035faf4b

+17 -139
-4
drivers/mfd/88pm860x-core.c
··· 558 558 irq_set_chip_data(virq, d->host_data); 559 559 irq_set_chip_and_handler(virq, &pm860x_irq_chip, handle_edge_irq); 560 560 irq_set_nested_thread(virq, 1); 561 - #ifdef CONFIG_ARM 562 - set_irq_flags(virq, IRQF_VALID); 563 - #else 564 561 irq_set_noprobe(virq); 565 - #endif 566 562 return 0; 567 563 } 568 564
-4
drivers/mfd/ab8500-core.c
··· 565 565 irq_set_chip_and_handler(virq, &ab8500_irq_chip, 566 566 handle_simple_irq); 567 567 irq_set_nested_thread(virq, 1); 568 - #ifdef CONFIG_ARM 569 - set_irq_flags(virq, IRQF_VALID); 570 - #else 571 568 irq_set_noprobe(virq); 572 - #endif 573 569 574 570 return 0; 575 571 }
-7
drivers/mfd/arizona-irq.c
··· 174 174 irq_set_chip_data(virq, data); 175 175 irq_set_chip_and_handler(virq, &arizona_irq_chip, handle_simple_irq); 176 176 irq_set_nested_thread(virq, 1); 177 - 178 - /* ARM needs us to explicitly flag the IRQ as valid 179 - * and will set them noprobe when we do so. */ 180 - #ifdef CONFIG_ARM 181 - set_irq_flags(virq, IRQF_VALID); 182 - #else 183 177 irq_set_noprobe(virq); 184 - #endif 185 178 186 179 return 0; 187 180 }
+2 -2
drivers/mfd/asic3.c
··· 411 411 412 412 irq_set_chip_data(irq, asic); 413 413 irq_set_handler(irq, handle_level_irq); 414 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 414 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 415 415 } 416 416 417 417 asic3_write_register(asic, ASIC3_OFFSET(INTR, INT_MASK), ··· 431 431 irq_base = asic->irq_base; 432 432 433 433 for (irq = irq_base; irq < irq_base + ASIC3_NR_IRQS; irq++) { 434 - set_irq_flags(irq, 0); 434 + irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 435 435 irq_set_chip_and_handler(irq, NULL, NULL); 436 436 irq_set_chip_data(irq, NULL); 437 437 }
-1
drivers/mfd/db8500-prcmu.c
··· 2654 2654 { 2655 2655 irq_set_chip_and_handler(virq, &prcmu_irq_chip, 2656 2656 handle_simple_irq); 2657 - set_irq_flags(virq, IRQF_VALID); 2658 2657 2659 2658 return 0; 2660 2659 }
+1 -5
drivers/mfd/ezx-pcap.c
··· 463 463 for (i = pcap->irq_base; i < (pcap->irq_base + PCAP_NIRQS); i++) { 464 464 irq_set_chip_and_handler(i, &pcap_irq_chip, handle_simple_irq); 465 465 irq_set_chip_data(i, pcap); 466 - #ifdef CONFIG_ARM 467 - set_irq_flags(i, IRQF_VALID); 468 - #else 469 - irq_set_noprobe(i); 470 - #endif 466 + irq_clear_status_flags(i, IRQ_NOREQUEST | IRQ_NOPROBE); 471 467 } 472 468 473 469 /* mask/ack all PCAP interrupts */
+2 -2
drivers/mfd/htc-egpio.c
··· 350 350 irq_set_chip_and_handler(irq, &egpio_muxed_chip, 351 351 handle_simple_irq); 352 352 irq_set_chip_data(irq, ei); 353 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 353 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 354 354 } 355 355 irq_set_irq_type(ei->chained_irq, IRQ_TYPE_EDGE_RISING); 356 356 irq_set_handler_data(ei->chained_irq, ei); ··· 376 376 irq_end = ei->irq_start + ei->nirqs; 377 377 for (irq = ei->irq_start; irq < irq_end; irq++) { 378 378 irq_set_chip_and_handler(irq, NULL, NULL); 379 - set_irq_flags(irq, 0); 379 + irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 380 380 } 381 381 irq_set_chained_handler(ei->chained_irq, NULL); 382 382 device_init_wakeup(&pdev->dev, 0);
+1 -5
drivers/mfd/htc-i2cpld.c
··· 330 330 irq_set_chip_and_handler(irq, &htcpld_muxed_chip, 331 331 handle_simple_irq); 332 332 irq_set_chip_data(irq, chip); 333 - #ifdef CONFIG_ARM 334 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 335 - #else 336 - irq_set_probe(irq); 337 - #endif 333 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 338 334 } 339 335 340 336 return ret;
-5
drivers/mfd/lp8788-irq.c
··· 141 141 irq_set_chip_data(virq, irqd); 142 142 irq_set_chip_and_handler(virq, chip, handle_edge_irq); 143 143 irq_set_nested_thread(virq, 1); 144 - 145 - #ifdef CONFIG_ARM 146 - set_irq_flags(virq, IRQF_VALID); 147 - #else 148 144 irq_set_noprobe(virq); 149 - #endif 150 145 151 146 return 0; 152 147 }
+1 -4
drivers/mfd/max8925-core.c
··· 650 650 irq_set_chip_data(virq, d->host_data); 651 651 irq_set_chip_and_handler(virq, &max8925_irq_chip, handle_edge_irq); 652 652 irq_set_nested_thread(virq, 1); 653 - #ifdef CONFIG_ARM 654 - set_irq_flags(virq, IRQF_VALID); 655 - #else 656 653 irq_set_noprobe(virq); 657 - #endif 654 + 658 655 return 0; 659 656 } 660 657
+1 -4
drivers/mfd/max8997-irq.c
··· 295 295 irq_set_chip_data(irq, max8997); 296 296 irq_set_chip_and_handler(irq, &max8997_irq_chip, handle_edge_irq); 297 297 irq_set_nested_thread(irq, 1); 298 - #ifdef CONFIG_ARM 299 - set_irq_flags(irq, IRQF_VALID); 300 - #else 301 298 irq_set_noprobe(irq); 302 - #endif 299 + 303 300 return 0; 304 301 } 305 302
+1 -4
drivers/mfd/max8998-irq.c
··· 206 206 irq_set_chip_data(irq, max8998); 207 207 irq_set_chip_and_handler(irq, &max8998_irq_chip, handle_edge_irq); 208 208 irq_set_nested_thread(irq, 1); 209 - #ifdef CONFIG_ARM 210 - set_irq_flags(irq, IRQF_VALID); 211 - #else 212 209 irq_set_noprobe(irq); 213 - #endif 210 + 214 211 return 0; 215 212 } 216 213
-4
drivers/mfd/mt6397-core.c
··· 142 142 irq_set_chip_data(irq, mt6397); 143 143 irq_set_chip_and_handler(irq, &mt6397_irq_chip, handle_level_irq); 144 144 irq_set_nested_thread(irq, 1); 145 - #ifdef CONFIG_ARM 146 - set_irq_flags(irq, IRQF_VALID); 147 - #else 148 145 irq_set_noprobe(irq); 149 - #endif 150 146 151 147 return 0; 152 148 }
+1 -4
drivers/mfd/pm8921-core.c
··· 289 289 290 290 irq_set_chip_and_handler(irq, &pm8xxx_irq_chip, handle_level_irq); 291 291 irq_set_chip_data(irq, chip); 292 - #ifdef CONFIG_ARM 293 - set_irq_flags(irq, IRQF_VALID); 294 - #else 295 292 irq_set_noprobe(irq); 296 - #endif 293 + 297 294 return 0; 298 295 } 299 296
+1 -3
drivers/mfd/rc5t583-irq.c
··· 386 386 irq_set_chip_and_handler(__irq, &rc5t583_irq_chip, 387 387 handle_simple_irq); 388 388 irq_set_nested_thread(__irq, 1); 389 - #ifdef CONFIG_ARM 390 - set_irq_flags(__irq, IRQF_VALID); 391 - #endif 389 + irq_clear_status_flags(__irq, IRQ_NOREQUEST); 392 390 } 393 391 394 392 ret = request_threaded_irq(irq, NULL, rc5t583_irq, IRQF_ONESHOT,
-7
drivers/mfd/stmpe.c
··· 971 971 irq_set_chip_data(virq, stmpe); 972 972 irq_set_chip_and_handler(virq, chip, handle_edge_irq); 973 973 irq_set_nested_thread(virq, 1); 974 - #ifdef CONFIG_ARM 975 - set_irq_flags(virq, IRQF_VALID); 976 - #else 977 974 irq_set_noprobe(virq); 978 - #endif 979 975 980 976 return 0; 981 977 } 982 978 983 979 static void stmpe_irq_unmap(struct irq_domain *d, unsigned int virq) 984 980 { 985 - #ifdef CONFIG_ARM 986 - set_irq_flags(virq, 0); 987 - #endif 988 981 irq_set_chip_and_handler(virq, NULL, NULL); 989 982 irq_set_chip_data(virq, NULL); 990 983 }
-6
drivers/mfd/t7l66xb.c
··· 246 246 for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) { 247 247 irq_set_chip_and_handler(irq, &t7l66xb_chip, handle_level_irq); 248 248 irq_set_chip_data(irq, t7l66xb); 249 - #ifdef CONFIG_ARM 250 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 251 - #endif 252 249 } 253 250 254 251 irq_set_irq_type(t7l66xb->irq, IRQ_TYPE_EDGE_FALLING); ··· 264 267 irq_set_handler_data(t7l66xb->irq, NULL); 265 268 266 269 for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) { 267 - #ifdef CONFIG_ARM 268 - set_irq_flags(irq, 0); 269 - #endif 270 270 irq_set_chip(irq, NULL); 271 271 irq_set_chip_data(irq, NULL); 272 272 }
-7
drivers/mfd/tc3589x.c
··· 215 215 irq_set_chip_and_handler(virq, &dummy_irq_chip, 216 216 handle_edge_irq); 217 217 irq_set_nested_thread(virq, 1); 218 - #ifdef CONFIG_ARM 219 - set_irq_flags(virq, IRQF_VALID); 220 - #else 221 218 irq_set_noprobe(virq); 222 - #endif 223 219 224 220 return 0; 225 221 } 226 222 227 223 static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq) 228 224 { 229 - #ifdef CONFIG_ARM 230 - set_irq_flags(virq, 0); 231 - #endif 232 225 irq_set_chip_and_handler(virq, NULL, NULL); 233 226 irq_set_chip_data(virq, NULL); 234 227 }
+2 -2
drivers/mfd/tc6393xb.c
··· 586 586 for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { 587 587 irq_set_chip_and_handler(irq, &tc6393xb_chip, handle_edge_irq); 588 588 irq_set_chip_data(irq, tc6393xb); 589 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 589 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 590 590 } 591 591 592 592 irq_set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING); ··· 605 605 irq_base = tc6393xb->irq_base; 606 606 607 607 for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { 608 - set_irq_flags(irq, 0); 608 + irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 609 609 irq_set_chip(irq, NULL); 610 610 irq_set_chip_data(irq, NULL); 611 611 }
-7
drivers/mfd/tps6586x.c
··· 299 299 irq_set_chip_data(virq, tps6586x); 300 300 irq_set_chip_and_handler(virq, &tps6586x_irq_chip, handle_simple_irq); 301 301 irq_set_nested_thread(virq, 1); 302 - 303 - /* ARM needs us to explicitly flag the IRQ as valid 304 - * and will set them noprobe when we do so. */ 305 - #ifdef CONFIG_ARM 306 - set_irq_flags(virq, IRQF_VALID); 307 - #else 308 302 irq_set_noprobe(virq); 309 - #endif 310 303 311 304 return 0; 312 305 }
+1 -7
drivers/mfd/tps65912-irq.c
··· 197 197 irq_set_chip_and_handler(cur_irq, &tps65912_irq_chip, 198 198 handle_edge_irq); 199 199 irq_set_nested_thread(cur_irq, 1); 200 - /* ARM needs us to explicitly flag the IRQ as valid 201 - * and will set them noprobe when we do so. */ 202 - #ifdef CONFIG_ARM 203 - set_irq_flags(cur_irq, IRQF_VALID); 204 - #else 205 - irq_set_noprobe(cur_irq); 206 - #endif 200 + irq_clear_status_flags(cur_irq, IRQ_NOREQUEST | IRQ_NOPROBE); 207 201 } 208 202 209 203 ret = request_threaded_irq(irq, NULL, tps65912_irq, flags,
+1 -10
drivers/mfd/twl4030-irq.c
··· 419 419 420 420 static inline void activate_irq(int irq) 421 421 { 422 - #ifdef CONFIG_ARM 423 - /* 424 - * ARM requires an extra step to clear IRQ_NOREQUEST, which it 425 - * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE. 426 - */ 427 - set_irq_flags(irq, IRQF_VALID); 428 - #else 429 - /* same effect on other architectures */ 430 - irq_set_noprobe(irq); 431 - #endif 422 + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); 432 423 } 433 424 434 425 /*----------------------------------------------------------------------*/
-13
drivers/mfd/twl6030-irq.c
··· 352 352 irq_set_chip_and_handler(virq, &pdata->irq_chip, handle_simple_irq); 353 353 irq_set_nested_thread(virq, true); 354 354 irq_set_parent(virq, pdata->twl_irq); 355 - 356 - #ifdef CONFIG_ARM 357 - /* 358 - * ARM requires an extra step to clear IRQ_NOREQUEST, which it 359 - * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE. 360 - */ 361 - set_irq_flags(virq, IRQF_VALID); 362 - #else 363 - /* same effect on other architectures */ 364 355 irq_set_noprobe(virq); 365 - #endif 366 356 367 357 return 0; 368 358 } 369 359 370 360 static void twl6030_irq_unmap(struct irq_domain *d, unsigned int virq) 371 361 { 372 - #ifdef CONFIG_ARM 373 - set_irq_flags(virq, 0); 374 - #endif 375 362 irq_set_chip_and_handler(virq, NULL, NULL); 376 363 irq_set_chip_data(virq, NULL); 377 364 }
+1 -1
drivers/mfd/ucb1x00-core.c
··· 562 562 563 563 irq_set_chip_and_handler(irq, &ucb1x00_irqchip, handle_edge_irq); 564 564 irq_set_chip_data(irq, ucb); 565 - set_irq_flags(irq, IRQF_VALID | IRQ_NOREQUEST); 565 + irq_clear_status_flags(irq, IRQ_NOREQUEST); 566 566 } 567 567 568 568 irq_set_irq_type(ucb->irq, IRQ_TYPE_EDGE_RISING);
-7
drivers/mfd/wm831x-irq.c
··· 552 552 irq_set_chip_data(virq, h->host_data); 553 553 irq_set_chip_and_handler(virq, &wm831x_irq_chip, handle_edge_irq); 554 554 irq_set_nested_thread(virq, 1); 555 - 556 - /* ARM needs us to explicitly flag the IRQ as valid 557 - * and will set them noprobe when we do so. */ 558 - #ifdef CONFIG_ARM 559 - set_irq_flags(virq, IRQF_VALID); 560 - #else 561 555 irq_set_noprobe(virq); 562 - #endif 563 556 564 557 return 0; 565 558 }
+1 -7
drivers/mfd/wm8350-irq.c
··· 526 526 handle_edge_irq); 527 527 irq_set_nested_thread(cur_irq, 1); 528 528 529 - /* ARM needs us to explicitly flag the IRQ as valid 530 - * and will set them noprobe when we do so. */ 531 - #ifdef CONFIG_ARM 532 - set_irq_flags(cur_irq, IRQF_VALID); 533 - #else 534 - irq_set_noprobe(cur_irq); 535 - #endif 529 + irq_clear_status_flags(cur_irq, IRQ_NOREQUEST | IRQ_NOPROBE); 536 530 } 537 531 538 532 ret = request_threaded_irq(irq, NULL, wm8350_irq, flags,
-7
drivers/mfd/wm8994-irq.c
··· 172 172 irq_set_chip_data(virq, wm8994); 173 173 irq_set_chip_and_handler(virq, &wm8994_edge_irq_chip, handle_edge_irq); 174 174 irq_set_nested_thread(virq, 1); 175 - 176 - /* ARM needs us to explicitly flag the IRQ as valid 177 - * and will set them noprobe when we do so. */ 178 - #ifdef CONFIG_ARM 179 - set_irq_flags(virq, IRQF_VALID); 180 - #else 181 175 irq_set_noprobe(virq); 182 - #endif 183 176 184 177 return 0; 185 178 }