# Re: \[RFC PATCH\] irq: add irq\_domain translation infrastructure

- From: Sebastian Andrzej Siewior \<hidden\>
- Date: 2011-06-27 09:02:33 
- List: linux-devicetree
- Page: https://ratatoskr.run/linux-devicetree/2011/06/3734470
- Thread: https://ratatoskr.run/lkml/2011/05/3720582/t.md

```text
* Grant Likely | 2011-05-26 00:54:38 [-0600]:

>diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
>index 39645b6..9891cd4 100644
>--- a/arch/x86/kernel/devicetree.c
>+++ b/arch/x86/kernel/devicetree.c
>@@ -371,36 +321,49 @@ static struct of_ioapic_type of_ioapic_type[] =
> 	},
> };
> 
>-static int ioapic_xlate(struct irq_domain *id, const u32 *intspec, u32 intsize,
>-			u32 *out_hwirq, u32 *out_type)
>+static int ioapic_dt_translate(struct irq_domain *domain,
>+				struct device_node *controller,
>+				const u32 *intspec, u32 intsize,
>+				irq_hw_number_t *out_hwirq, u32 *out_type)
> {
>-	struct mp_ioapic_gsi *gsi_cfg;
> 	struct io_apic_irq_attr attr;
> 	struct of_ioapic_type *it;
> 	u32 line, idx, type;
>+	int rc;
> 
>-	if (intsize < 2)
>+	if (controller != domain->of_node)
> 		return -EINVAL;

Is there a reason not havining the (controller != domain->of_node) check
in irq_create_of_mapping()?

Sebastian
```
