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

irq_domain: Remove 'new' irq_domain in favour of the ppc one

This patch removes the simplistic implementation of irq_domains and enables
the powerpc infrastructure for all irq_domain users. The powerpc
infrastructure includes support for complex mappings between Linux and
hardware irq numbers, and can manage allocation of irq_descs.

This patch also converts the few users of irq_domain_add()/irq_domain_del()
to call irq_domain_add_legacy() instead.

v3: Fix bug that set up too many irqs in translation range.
v2: Fix removal of irq_alloc_descs() call in gic driver

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Milton Miller <miltonm@bga.com>
Tested-by: Olof Johansson <olof@lixom.net>

+71 -263
+37 -48
arch/arm/common/gic.c
··· 51 51 }; 52 52 53 53 struct gic_chip_data { 54 - unsigned int irq_offset; 55 54 union gic_base dist_base; 56 55 union gic_base cpu_base; 57 56 #ifdef CONFIG_CPU_PM ··· 60 61 u32 __percpu *saved_ppi_enable; 61 62 u32 __percpu *saved_ppi_conf; 62 63 #endif 63 - #ifdef CONFIG_IRQ_DOMAIN 64 - struct irq_domain domain; 65 - #endif 64 + struct irq_domain *domain; 66 65 unsigned int gic_irqs; 67 66 #ifdef CONFIG_GIC_NON_BANKED 68 67 void __iomem *(*get_base)(union gic_base *); ··· 279 282 irqnr = irqstat & ~0x1c00; 280 283 281 284 if (likely(irqnr > 15 && irqnr < 1021)) { 282 - irqnr = irq_domain_to_irq(&gic->domain, irqnr); 285 + irqnr = irq_find_mapping(gic->domain, irqnr); 283 286 handle_IRQ(irqnr, regs); 284 287 continue; 285 288 } ··· 311 314 if (gic_irq == 1023) 312 315 goto out; 313 316 314 - cascade_irq = irq_domain_to_irq(&chip_data->domain, gic_irq); 315 - if (unlikely(gic_irq < 32 || gic_irq > 1020 || cascade_irq >= NR_IRQS)) 317 + cascade_irq = irq_find_mapping(chip_data->domain, gic_irq); 318 + if (unlikely(gic_irq < 32 || gic_irq > 1020)) 316 319 do_bad_IRQ(cascade_irq, desc); 317 320 else 318 321 generic_handle_irq(cascade_irq); ··· 345 348 346 349 static void __init gic_dist_init(struct gic_chip_data *gic) 347 350 { 348 - unsigned int i, irq; 351 + unsigned int i; 349 352 u32 cpumask; 350 353 unsigned int gic_irqs = gic->gic_irqs; 351 - struct irq_domain *domain = &gic->domain; 352 354 void __iomem *base = gic_data_dist_base(gic); 353 355 u32 cpu = cpu_logical_map(smp_processor_id()); 354 356 ··· 381 385 */ 382 386 for (i = 32; i < gic_irqs; i += 32) 383 387 writel_relaxed(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); 384 - 385 - /* 386 - * Setup the Linux IRQ subsystem. 387 - */ 388 - irq_domain_for_each_irq(domain, i, irq) { 389 - if (i < 32) { 390 - irq_set_percpu_devid(irq); 391 - irq_set_chip_and_handler(irq, &gic_chip, 392 - handle_percpu_devid_irq); 393 - set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN); 394 - } else { 395 - irq_set_chip_and_handler(irq, &gic_chip, 396 - handle_fasteoi_irq); 397 - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 398 - } 399 - irq_set_chip_data(irq, gic); 400 - } 401 388 402 389 writel_relaxed(1, base + GIC_DIST_CTRL); 403 390 } ··· 597 618 } 598 619 #endif 599 620 600 - #ifdef CONFIG_OF 621 + static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, 622 + irq_hw_number_t hw) 623 + { 624 + if (hw < 32) { 625 + irq_set_percpu_devid(irq); 626 + irq_set_chip_and_handler(irq, &gic_chip, 627 + handle_percpu_devid_irq); 628 + set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN); 629 + } else { 630 + irq_set_chip_and_handler(irq, &gic_chip, 631 + handle_fasteoi_irq); 632 + set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 633 + } 634 + irq_set_chip_data(irq, d->host_data); 635 + return 0; 636 + } 637 + 601 638 static int gic_irq_domain_xlate(struct irq_domain *d, 602 639 struct device_node *controller, 603 640 const u32 *intspec, unsigned int intsize, ··· 634 639 *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK; 635 640 return 0; 636 641 } 637 - #endif 638 642 639 643 struct irq_domain_ops gic_irq_domain_ops = { 640 - #ifdef CONFIG_OF 644 + .map = gic_irq_domain_map, 641 645 .xlate = gic_irq_domain_xlate, 642 - #endif 643 646 }; 644 647 645 648 void __init gic_init_bases(unsigned int gic_nr, int irq_start, 646 649 void __iomem *dist_base, void __iomem *cpu_base, 647 - u32 percpu_offset) 650 + u32 percpu_offset, struct device_node *node) 648 651 { 652 + irq_hw_number_t hwirq_base; 649 653 struct gic_chip_data *gic; 650 - struct irq_domain *domain; 651 - int gic_irqs; 654 + int gic_irqs, irq_base; 652 655 653 656 BUG_ON(gic_nr >= MAX_GIC_NR); 654 657 655 658 gic = &gic_data[gic_nr]; 656 - domain = &gic->domain; 657 659 #ifdef CONFIG_GIC_NON_BANKED 658 660 if (percpu_offset) { /* Frankein-GIC without banked registers... */ 659 661 unsigned int cpu; ··· 686 694 * For primary GICs, skip over SGIs. 687 695 * For secondary GICs, skip over PPIs, too. 688 696 */ 689 - domain->hwirq_base = 32; 697 + hwirq_base = 32; 690 698 if (gic_nr == 0) { 691 699 if ((irq_start & 31) > 0) { 692 - domain->hwirq_base = 16; 700 + hwirq_base = 16; 693 701 if (irq_start != -1) 694 702 irq_start = (irq_start & ~31) + 16; 695 703 } ··· 705 713 gic_irqs = 1020; 706 714 gic->gic_irqs = gic_irqs; 707 715 708 - domain->nr_irq = gic_irqs - domain->hwirq_base; 709 - domain->irq_base = irq_alloc_descs(irq_start, 16, domain->nr_irq, 710 - numa_node_id()); 711 - if (IS_ERR_VALUE(domain->irq_base)) { 716 + gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */ 717 + irq_base = irq_alloc_descs(irq_start, 16, gic_irqs, numa_node_id()); 718 + if (IS_ERR_VALUE(irq_base)) { 712 719 WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n", 713 720 irq_start); 714 - domain->irq_base = irq_start; 721 + irq_base = irq_start; 715 722 } 716 - domain->host_data = gic; 717 - domain->ops = &gic_irq_domain_ops; 718 - irq_domain_add(domain); 723 + gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base, 724 + hwirq_base, &gic_irq_domain_ops, gic); 725 + if (WARN_ON(!gic->domain)) 726 + return; 719 727 720 728 gic_chip.flags |= gic_arch_extn.flags; 721 729 gic_dist_init(gic); ··· 760 768 void __iomem *dist_base; 761 769 u32 percpu_offset; 762 770 int irq; 763 - struct irq_domain *domain = &gic_data[gic_cnt].domain; 764 771 765 772 if (WARN_ON(!node)) 766 773 return -ENODEV; ··· 773 782 if (of_property_read_u32(node, "cpu-offset", &percpu_offset)) 774 783 percpu_offset = 0; 775 784 776 - domain->of_node = of_node_get(node); 777 - 778 - gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset); 785 + gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset, node); 779 786 780 787 if (parent) { 781 788 irq = irq_of_parse_and_map(node, 0);
+5 -11
arch/arm/common/vic.c
··· 56 56 u32 int_enable; 57 57 u32 soft_int; 58 58 u32 protect; 59 - struct irq_domain domain; 59 + struct irq_domain *domain; 60 60 }; 61 61 62 62 /* we cannot allocate memory when VICs are initially registered */ ··· 192 192 v->resume_sources = resume_sources; 193 193 v->irq = irq; 194 194 vic_id++; 195 - 196 - v->domain.irq_base = irq; 197 - v->domain.nr_irq = 32; 198 - #ifdef CONFIG_OF_IRQ 199 - v->domain.of_node = of_node_get(node); 200 - #endif /* CONFIG_OF */ 201 - v->domain.ops = &irq_domain_simple_ops; 202 - irq_domain_add(&v->domain); 195 + v->domain = irq_domain_add_legacy(node, 32, irq, 0, 196 + &irq_domain_simple_ops, v); 203 197 } 204 198 205 199 static void vic_ack_irq(struct irq_data *d) ··· 342 348 vic_register(base, irq_start, 0, node); 343 349 } 344 350 345 - static void __init __vic_init(void __iomem *base, unsigned int irq_start, 351 + void __init __vic_init(void __iomem *base, unsigned int irq_start, 346 352 u32 vic_sources, u32 resume_sources, 347 353 struct device_node *node) 348 354 { ··· 438 444 stat = readl_relaxed(vic->base + VIC_IRQ_STATUS); 439 445 while (stat) { 440 446 irq = ffs(stat) - 1; 441 - handle_IRQ(irq_domain_to_irq(&vic->domain, irq), regs); 447 + handle_IRQ(irq_find_mapping(vic->domain, irq), regs); 442 448 stat &= ~(1 << irq); 443 449 handled = 1; 444 450 }
+2 -2
arch/arm/include/asm/hardware/gic.h
··· 39 39 extern struct irq_chip gic_arch_extn; 40 40 41 41 void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *, 42 - u32 offset); 42 + u32 offset, struct device_node *); 43 43 int gic_of_init(struct device_node *node, struct device_node *parent); 44 44 void gic_secondary_init(unsigned int); 45 45 void gic_handle_irq(struct pt_regs *regs); ··· 49 49 static inline void gic_init(unsigned int nr, int start, 50 50 void __iomem *dist , void __iomem *cpu) 51 51 { 52 - gic_init_bases(nr, start, dist, cpu, 0); 52 + gic_init_bases(nr, start, dist, cpu, 0, NULL); 53 53 } 54 54 55 55 #endif
+2
arch/arm/include/asm/hardware/vic.h
··· 47 47 struct device_node; 48 48 struct pt_regs; 49 49 50 + void __vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, 51 + u32 resume_sources, struct device_node *node); 50 52 void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); 51 53 int vic_of_init(struct device_node *node, struct device_node *parent); 52 54 void vic_handle_irq(struct pt_regs *regs);
+1 -1
arch/arm/mach-exynos/common.c
··· 402 402 gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000; 403 403 404 404 if (!of_have_populated_dt()) 405 - gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset); 405 + gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL); 406 406 #ifdef CONFIG_OF 407 407 else 408 408 of_irq_init(exynos4_dt_irq_match);
+5 -2
arch/arm/mach-versatile/core.c
··· 98 98 99 99 void __init versatile_init_irq(void) 100 100 { 101 - vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0); 102 - irq_domain_generate_simple(vic_of_match, VERSATILE_VIC_BASE, IRQ_VIC_START); 101 + struct device_node *np; 102 + 103 + np = of_find_matching_node_by_address(NULL, vic_of_match, 104 + VERSATILE_VIC_BASE); 105 + __vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0, np); 103 106 104 107 writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); 105 108
+2 -12
drivers/mfd/twl-core.c
··· 263 263 264 264 static struct twl_client twl_modules[TWL_NUM_SLAVES]; 265 265 266 - #ifdef CONFIG_IRQ_DOMAIN 267 - static struct irq_domain domain; 268 - #endif 269 - 270 266 /* mapping the module id to slave id and base address */ 271 267 struct twl_mapping { 272 268 unsigned char sid; /* Slave ID */ ··· 1223 1227 1224 1228 pdata->irq_base = status; 1225 1229 pdata->irq_end = pdata->irq_base + nr_irqs; 1226 - 1227 - #ifdef CONFIG_IRQ_DOMAIN 1228 - domain.irq_base = pdata->irq_base; 1229 - domain.nr_irq = nr_irqs; 1230 - domain.of_node = of_node_get(node); 1231 - domain.ops = &irq_domain_simple_ops; 1232 - irq_domain_add(&domain); 1233 - #endif 1230 + irq_domain_add_legacy(node, nr_irqs, pdata->irq_base, 0, 1231 + &irq_domain_simple_ops, NULL); 1234 1232 1235 1233 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { 1236 1234 dev_dbg(&client->dev, "can't talk I2C?\n");
+4 -41
include/linux/irqdomain.h
··· 55 55 * @map: Create or update a mapping between a virtual irq number and a hw 56 56 * irq number. This is called only once for a given mapping. 57 57 * @unmap: Dispose of such a mapping 58 - * @to_irq: (optional) given a local hardware irq number, return the linux 59 - * irq number. If to_irq is not implemented, then the irq_domain 60 - * will use this translation: irq = (domain->irq_base + hwirq) 61 58 * @xlate: Given a device tree node and interrupt specifier, decode 62 59 * the hardware irq number and linux irq type value. 63 60 * ··· 67 70 int (*match)(struct irq_domain *d, struct device_node *node); 68 71 int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw); 69 72 void (*unmap)(struct irq_domain *d, unsigned int virq); 70 - unsigned int (*to_irq)(struct irq_domain *d, unsigned long hwirq); 71 73 int (*xlate)(struct irq_domain *d, struct device_node *node, 72 74 const u32 *intspec, unsigned int intsize, 73 75 unsigned long *out_hwirq, unsigned int *out_type); ··· 110 114 void *host_data; 111 115 irq_hw_number_t inval_irq; 112 116 113 - unsigned int irq_base; 114 - unsigned int nr_irq; 115 - unsigned int hwirq_base; 116 - 117 117 /* Optional device node pointer */ 118 118 struct device_node *of_node; 119 119 }; 120 120 121 121 #ifdef CONFIG_IRQ_DOMAIN 122 - #ifdef CONFIG_PPC 123 122 struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, 124 123 unsigned int size, 125 124 unsigned int first_irq, ··· 144 153 return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops, 145 154 host_data); 146 155 } 156 + extern struct irq_domain *irq_find_host(struct device_node *node); 157 + extern void irq_set_default_host(struct irq_domain *host); 158 + extern void irq_set_virq_count(unsigned int count); 159 + 147 160 148 161 extern unsigned int irq_create_mapping(struct irq_domain *host, 149 162 irq_hw_number_t hwirq); ··· 162 167 extern unsigned int irq_linear_revmap(struct irq_domain *host, 163 168 irq_hw_number_t hwirq); 164 169 165 - #else /* CONFIG_PPC */ 166 - 167 - /** 168 - * irq_domain_to_irq() - Translate from a hardware irq to a linux irq number 169 - * 170 - * Returns the linux irq number associated with a hardware irq. By default, 171 - * the mapping is irq == domain->irq_base + hwirq, but this mapping can 172 - * be overridden if the irq_domain implements a .to_irq() hook. 173 - */ 174 - static inline unsigned int irq_domain_to_irq(struct irq_domain *d, 175 - unsigned long hwirq) 176 - { 177 - if (d->ops->to_irq) 178 - return d->ops->to_irq(d, hwirq); 179 - if (WARN_ON(hwirq < d->hwirq_base)) 180 - return 0; 181 - return d->irq_base + hwirq - d->hwirq_base; 182 - } 183 - 184 - #define irq_domain_for_each_hwirq(d, hw) \ 185 - for (hw = d->hwirq_base; hw < d->hwirq_base + d->nr_irq; hw++) 186 - 187 - #define irq_domain_for_each_irq(d, hw, irq) \ 188 - for (hw = d->hwirq_base, irq = irq_domain_to_irq(d, hw); \ 189 - hw < d->hwirq_base + d->nr_irq; \ 190 - hw++, irq = irq_domain_to_irq(d, hw)) 191 - 192 - extern void irq_domain_add(struct irq_domain *domain); 193 - extern void irq_domain_del(struct irq_domain *domain); 194 - 195 170 extern struct irq_domain_ops irq_domain_simple_ops; 196 - 197 171 #if defined(CONFIG_OF_IRQ) 198 172 extern void irq_domain_add_simple(struct device_node *controller, int irq_base); 199 173 extern void irq_domain_generate_simple(const struct of_device_id *match, ··· 171 207 static inline void irq_domain_generate_simple(const struct of_device_id *match, 172 208 u64 phys_base, unsigned int irq_start) { } 173 209 #endif /* !CONFIG_OF_IRQ */ 174 - #endif /* !CONFIG_PPC */ 175 210 #endif /* CONFIG_IRQ_DOMAIN */ 176 211 177 212 #endif /* _LINUX_IRQDOMAIN_H */
+13 -146
kernel/irq/irqdomain.c
··· 22 22 static LIST_HEAD(irq_domain_list); 23 23 static DEFINE_MUTEX(irq_domain_mutex); 24 24 25 - #ifdef CONFIG_PPC 26 25 static DEFINE_MUTEX(revmap_trees_mutex); 27 26 static unsigned int irq_virq_count = NR_IRQS; 28 27 static struct irq_domain *irq_default_domain; ··· 693 694 __initcall(irq_debugfs_init); 694 695 #endif /* CONFIG_VIRQ_DEBUG */ 695 696 696 - #else /* CONFIG_PPC */ 697 - 698 - /** 699 - * irq_domain_add() - Register an irq_domain 700 - * @domain: ptr to initialized irq_domain structure 701 - * 702 - * Registers an irq_domain structure. The irq_domain must at a minimum be 703 - * initialized with an ops structure pointer, and either a ->to_irq hook or 704 - * a valid irq_base value. Everything else is optional. 705 - */ 706 - void irq_domain_add(struct irq_domain *domain) 697 + int irq_domain_simple_map(struct irq_domain *d, unsigned int irq, 698 + irq_hw_number_t hwirq) 707 699 { 708 - struct irq_data *d; 709 - int hwirq, irq; 710 - 711 - /* 712 - * This assumes that the irq_domain owner has already allocated 713 - * the irq_descs. This block will be removed when support for dynamic 714 - * allocation of irq_descs is added to irq_domain. 715 - */ 716 - irq_domain_for_each_irq(domain, hwirq, irq) { 717 - d = irq_get_irq_data(irq); 718 - if (!d) { 719 - WARN(1, "error: assigning domain to non existant irq_desc"); 720 - return; 721 - } 722 - if (d->domain) { 723 - /* things are broken; just report, don't clean up */ 724 - WARN(1, "error: irq_desc already assigned to a domain"); 725 - return; 726 - } 727 - d->domain = domain; 728 - d->hwirq = hwirq; 729 - } 730 - 731 - mutex_lock(&irq_domain_mutex); 732 - list_add(&domain->link, &irq_domain_list); 733 - mutex_unlock(&irq_domain_mutex); 700 + return 0; 734 701 } 735 - 736 - /** 737 - * irq_domain_del() - Unregister an irq_domain 738 - * @domain: ptr to registered irq_domain. 739 - */ 740 - void irq_domain_del(struct irq_domain *domain) 741 - { 742 - struct irq_data *d; 743 - int hwirq, irq; 744 - 745 - mutex_lock(&irq_domain_mutex); 746 - list_del(&domain->link); 747 - mutex_unlock(&irq_domain_mutex); 748 - 749 - /* Clear the irq_domain assignments */ 750 - irq_domain_for_each_irq(domain, hwirq, irq) { 751 - d = irq_get_irq_data(irq); 752 - d->domain = NULL; 753 - } 754 - } 755 - 756 - #if defined(CONFIG_OF_IRQ) 757 - /** 758 - * irq_create_of_mapping() - Map a linux irq number from a DT interrupt spec 759 - * 760 - * Used by the device tree interrupt mapping code to translate a device tree 761 - * interrupt specifier to a valid linux irq number. Returns either a valid 762 - * linux IRQ number or 0. 763 - * 764 - * When the caller no longer need the irq number returned by this function it 765 - * should arrange to call irq_dispose_mapping(). 766 - */ 767 - unsigned int irq_create_of_mapping(struct device_node *controller, 768 - const u32 *intspec, unsigned int intsize) 769 - { 770 - struct irq_domain *domain; 771 - unsigned long hwirq; 772 - unsigned int irq, type; 773 - int rc = -EINVAL; 774 - 775 - /* Find a domain which can translate the irq spec */ 776 - mutex_lock(&irq_domain_mutex); 777 - list_for_each_entry(domain, &irq_domain_list, link) { 778 - if (!domain->ops->xlate) 779 - continue; 780 - rc = domain->ops->xlate(domain, controller, 781 - intspec, intsize, &hwirq, &type); 782 - if (rc == 0) 783 - break; 784 - } 785 - mutex_unlock(&irq_domain_mutex); 786 - 787 - if (rc != 0) 788 - return 0; 789 - 790 - irq = irq_domain_to_irq(domain, hwirq); 791 - if (type != IRQ_TYPE_NONE) 792 - irq_set_irq_type(irq, type); 793 - pr_debug("%s: mapped hwirq=%i to irq=%i, flags=%x\n", 794 - controller->full_name, (int)hwirq, irq, type); 795 - return irq; 796 - } 797 - EXPORT_SYMBOL_GPL(irq_create_of_mapping); 798 - 799 - /** 800 - * irq_dispose_mapping() - Discard a mapping created by irq_create_of_mapping() 801 - * @irq: linux irq number to be discarded 802 - * 803 - * Calling this function indicates the caller no longer needs a reference to 804 - * the linux irq number returned by a prior call to irq_create_of_mapping(). 805 - */ 806 - void irq_dispose_mapping(unsigned int irq) 807 - { 808 - /* 809 - * nothing yet; will be filled when support for dynamic allocation of 810 - * irq_descs is added to irq_domain 811 - */ 812 - } 813 - EXPORT_SYMBOL_GPL(irq_dispose_mapping); 814 702 815 703 int irq_domain_simple_xlate(struct irq_domain *d, 816 704 struct device_node *controller, ··· 708 822 return -EINVAL; 709 823 if (intsize < 1) 710 824 return -EINVAL; 711 - if (d->nr_irq && ((intspec[0] < d->hwirq_base) || 712 - (intspec[0] >= d->hwirq_base + d->nr_irq))) 713 - return -EINVAL; 714 - 715 825 *out_hwirq = intspec[0]; 716 826 *out_type = IRQ_TYPE_NONE; 717 827 if (intsize > 1) ··· 715 833 return 0; 716 834 } 717 835 718 - /** 719 - * irq_domain_create_simple() - Set up a 'simple' translation range 720 - */ 836 + struct irq_domain_ops irq_domain_simple_ops = { 837 + .map = irq_domain_simple_map, 838 + .xlate = irq_domain_simple_xlate, 839 + }; 840 + EXPORT_SYMBOL_GPL(irq_domain_simple_ops); 841 + 842 + #ifdef CONFIG_OF_IRQ 721 843 void irq_domain_add_simple(struct device_node *controller, int irq_base) 722 844 { 723 - struct irq_domain *domain; 724 - 725 - domain = kzalloc(sizeof(*domain), GFP_KERNEL); 726 - if (!domain) { 727 - WARN_ON(1); 728 - return; 729 - } 730 - 731 - domain->irq_base = irq_base; 732 - domain->of_node = of_node_get(controller); 733 - domain->ops = &irq_domain_simple_ops; 734 - irq_domain_add(domain); 845 + irq_domain_add_legacy(controller, 32, irq_base, 0, 846 + &irq_domain_simple_ops, NULL); 735 847 } 736 848 EXPORT_SYMBOL_GPL(irq_domain_add_simple); 737 849 ··· 740 864 irq_domain_add_simple(node, irq_start); 741 865 } 742 866 EXPORT_SYMBOL_GPL(irq_domain_generate_simple); 743 - #endif /* CONFIG_OF_IRQ */ 744 - 745 - struct irq_domain_ops irq_domain_simple_ops = { 746 - #ifdef CONFIG_OF_IRQ 747 - .xlate = irq_domain_simple_xlate, 748 - #endif /* CONFIG_OF_IRQ */ 749 - }; 750 - EXPORT_SYMBOL_GPL(irq_domain_simple_ops); 751 - 752 - #endif /* !CONFIG_PPC */ 867 + #endif