• Matti Vaittinen's avatar
    irqdomain: Simplify simple and legacy domain creation · 70114e7f
    Matti Vaittinen authored
    irq_domain_create_simple() and irq_domain_create_legacy() use
    __irq_domain_instantiate(), but have extra handling of allocating interrupt
    descriptors and associating interrupts in them. Some of that is duplicated.
    
    There are also call sites which have conditonals to invoke different
    interrupt domain creator functions, where one of them is usually
    irq_domain_create_legacy(). Alternatively they associate the interrupts for
    the legacy case after creating the domain.
    
    Moving the extra logic of irq_domain_create_simple()/legacy() into
    __irq_domain_instantiate() allows to consolidate that.
    
    Introduce hwirq_base and virq_base members in the irq_domain_info
    structure, which allows to transport the required information and add the
    conditional interrupt descriptor allocation and interrupt association into
    __irq_domain_instantiate().
    
    This reduces irq_domain_create_legacy() and irq_domain_create_simple() to
    trivial wrappers which fill in the info structure and allows call sites
    which must support the legacy case along with more modern mechanism to
    select the domain type via the parameters of the info struct.
    
    [ tglx: Massaged change log ]
    Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarMatti Vaittinen <mazziesaccount@gmail.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Link: https://lore.kernel.org/all/32d07bd79eb2b5416e24da9e9e8fe5955423dcf9.1723120028.git.mazziesaccount@gmail.com
    70114e7f
irqdomain.c 57.4 KB