x86/hpet: Use irq_find_matching_fwspec() to find remapping irqdomain
All possible parent domains have a select method now. Make use of it. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201024213535.443185-28-dwmw2@infradead.org
This commit is contained in:
committed by
Thomas Gleixner
parent
a491bb19f7
commit
c2a5881c28
@@ -543,8 +543,8 @@ static struct irq_domain *hpet_create_irq_domain(int hpet_id)
|
|||||||
{
|
{
|
||||||
struct msi_domain_info *domain_info;
|
struct msi_domain_info *domain_info;
|
||||||
struct irq_domain *parent, *d;
|
struct irq_domain *parent, *d;
|
||||||
struct irq_alloc_info info;
|
|
||||||
struct fwnode_handle *fn;
|
struct fwnode_handle *fn;
|
||||||
|
struct irq_fwspec fwspec;
|
||||||
|
|
||||||
if (x86_vector_domain == NULL)
|
if (x86_vector_domain == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -556,15 +556,6 @@ static struct irq_domain *hpet_create_irq_domain(int hpet_id)
|
|||||||
*domain_info = hpet_msi_domain_info;
|
*domain_info = hpet_msi_domain_info;
|
||||||
domain_info->data = (void *)(long)hpet_id;
|
domain_info->data = (void *)(long)hpet_id;
|
||||||
|
|
||||||
init_irq_alloc_info(&info, NULL);
|
|
||||||
info.type = X86_IRQ_ALLOC_TYPE_HPET_GET_PARENT;
|
|
||||||
info.devid = hpet_id;
|
|
||||||
parent = irq_remapping_get_irq_domain(&info);
|
|
||||||
if (parent == NULL)
|
|
||||||
parent = x86_vector_domain;
|
|
||||||
else
|
|
||||||
hpet_msi_controller.name = "IR-HPET-MSI";
|
|
||||||
|
|
||||||
fn = irq_domain_alloc_named_id_fwnode(hpet_msi_controller.name,
|
fn = irq_domain_alloc_named_id_fwnode(hpet_msi_controller.name,
|
||||||
hpet_id);
|
hpet_id);
|
||||||
if (!fn) {
|
if (!fn) {
|
||||||
@@ -572,6 +563,19 @@ static struct irq_domain *hpet_create_irq_domain(int hpet_id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fwspec.fwnode = fn;
|
||||||
|
fwspec.param_count = 1;
|
||||||
|
fwspec.param[0] = hpet_id;
|
||||||
|
|
||||||
|
parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY);
|
||||||
|
if (!parent) {
|
||||||
|
irq_domain_free_fwnode(fn);
|
||||||
|
kfree(domain_info);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (parent != x86_vector_domain)
|
||||||
|
hpet_msi_controller.name = "IR-HPET-MSI";
|
||||||
|
|
||||||
d = msi_create_irq_domain(fn, domain_info, parent);
|
d = msi_create_irq_domain(fn, domain_info, parent);
|
||||||
if (!d) {
|
if (!d) {
|
||||||
irq_domain_free_fwnode(fn);
|
irq_domain_free_fwnode(fn);
|
||||||
|
|||||||
Reference in New Issue
Block a user