.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Support for the interrupt controllers found on Power Macintosh, |
---|
3 | 4 | * currently Apple's "Grand Central" interrupt controller in all |
---|
.. | .. |
---|
7 | 8 | * Copyright (C) 1997 Paul Mackerras (paulus@samba.org) |
---|
8 | 9 | * Copyright (C) 2005 Benjamin Herrenschmidt (benh@kernel.crashing.org) |
---|
9 | 10 | * IBM, Corp. |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or |
---|
12 | | - * modify it under the terms of the GNU General Public License |
---|
13 | | - * as published by the Free Software Foundation; either version |
---|
14 | | - * 2 of the License, or (at your option) any later version. |
---|
15 | | - * |
---|
16 | 11 | */ |
---|
17 | 12 | |
---|
18 | 13 | #include <linux/stddef.h> |
---|
.. | .. |
---|
255 | 250 | return irq_linear_revmap(pmac_pic_host, irq); |
---|
256 | 251 | } |
---|
257 | 252 | |
---|
258 | | -#ifdef CONFIG_XMON |
---|
259 | | -static struct irqaction xmon_action = { |
---|
260 | | - .handler = xmon_irq, |
---|
261 | | - .flags = IRQF_NO_THREAD, |
---|
262 | | - .name = "NMI - XMON" |
---|
263 | | -}; |
---|
264 | | -#endif |
---|
265 | | - |
---|
266 | | -static struct irqaction gatwick_cascade_action = { |
---|
267 | | - .handler = gatwick_action, |
---|
268 | | - .flags = IRQF_NO_THREAD, |
---|
269 | | - .name = "cascade", |
---|
270 | | -}; |
---|
271 | | - |
---|
272 | 253 | static int pmac_pic_host_match(struct irq_domain *h, struct device_node *node, |
---|
273 | 254 | enum irq_domain_bus_token bus_token) |
---|
274 | 255 | { |
---|
.. | .. |
---|
389 | 370 | out_le32(&pmac_irq_hw[i]->enable, 0); |
---|
390 | 371 | |
---|
391 | 372 | /* Hookup cascade irq */ |
---|
392 | | - if (slave && pmac_irq_cascade) |
---|
393 | | - setup_irq(pmac_irq_cascade, &gatwick_cascade_action); |
---|
| 373 | + if (slave && pmac_irq_cascade) { |
---|
| 374 | + if (request_irq(pmac_irq_cascade, gatwick_action, |
---|
| 375 | + IRQF_NO_THREAD, "cascade", NULL)) |
---|
| 376 | + pr_err("Failed to register cascade interrupt\n"); |
---|
| 377 | + } |
---|
394 | 378 | |
---|
395 | 379 | printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); |
---|
396 | 380 | #ifdef CONFIG_XMON |
---|
397 | | - setup_irq(irq_create_mapping(NULL, 20), &xmon_action); |
---|
| 381 | + i = irq_create_mapping(NULL, 20); |
---|
| 382 | + if (request_irq(i, xmon_irq, IRQF_NO_THREAD, "NMI - XMON", NULL)) |
---|
| 383 | + pr_err("Failed to register NMI-XMON interrupt\n"); |
---|
398 | 384 | #endif |
---|
399 | 385 | } |
---|
400 | 386 | |
---|
.. | .. |
---|
417 | 403 | if (ints != NULL) |
---|
418 | 404 | break; |
---|
419 | 405 | device = device->parent; |
---|
420 | | - if (device && strcmp(device->type, "pci") != 0) |
---|
| 406 | + if (!of_node_is_type(device, "pci")) |
---|
421 | 407 | break; |
---|
422 | 408 | } |
---|
423 | 409 | if (ints == NULL) |
---|
.. | .. |
---|
446 | 432 | nmi_irq = irq_of_parse_and_map(pswitch, 0); |
---|
447 | 433 | if (nmi_irq) { |
---|
448 | 434 | mpic_irq_set_priority(nmi_irq, 9); |
---|
449 | | - setup_irq(nmi_irq, &xmon_action); |
---|
| 435 | + if (request_irq(nmi_irq, xmon_irq, IRQF_NO_THREAD, |
---|
| 436 | + "NMI - XMON", NULL)) |
---|
| 437 | + pr_err("Failed to register NMI-XMON interrupt\n"); |
---|
450 | 438 | } |
---|
451 | 439 | of_node_put(pswitch); |
---|
452 | 440 | } |
---|
.. | .. |
---|
553 | 541 | |
---|
554 | 542 | for_each_node_with_property(np, "interrupt-controller") { |
---|
555 | 543 | /* Skip /chosen/interrupt-controller */ |
---|
556 | | - if (strcmp(np->name, "chosen") == 0) |
---|
| 544 | + if (of_node_name_eq(np, "chosen")) |
---|
557 | 545 | continue; |
---|
558 | 546 | /* It seems like at least one person wants |
---|
559 | 547 | * to use BootX on a machine with an AppleKiwi |
---|
560 | 548 | * controller which happens to pretend to be an |
---|
561 | 549 | * interrupt controller too. */ |
---|
562 | | - if (strcmp(np->name, "AppleKiwi") == 0) |
---|
| 550 | + if (of_node_name_eq(np, "AppleKiwi")) |
---|
563 | 551 | continue; |
---|
564 | 552 | /* I think we found one ! */ |
---|
565 | 553 | of_irq_dflt_pic = np; |
---|