powerpc/85xx: Remove #ifdefs CONFIG_PPC_I8259 in mpc85xx_ds
All necessary items are declared all the time, no need to use a #ifdef CONFIG_PPC_I8259. Refactor CONFIG_PPC_I8259 actions into a dedicated init function. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230408140122.25293-6-pali@kernel.org
This commit is contained in:
parent
15c6ba7992
commit
f435f67024
@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include "mpc85xx.h"
|
#include "mpc85xx.h"
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_I8259
|
|
||||||
static void mpc85xx_8259_cascade(struct irq_desc *desc)
|
static void mpc85xx_8259_cascade(struct irq_desc *desc)
|
||||||
{
|
{
|
||||||
struct irq_chip *chip = irq_desc_get_chip(desc);
|
struct irq_chip *chip = irq_desc_get_chip(desc);
|
||||||
@ -45,29 +44,16 @@ static void mpc85xx_8259_cascade(struct irq_desc *desc)
|
|||||||
}
|
}
|
||||||
chip->irq_eoi(&desc->irq_data);
|
chip->irq_eoi(&desc->irq_data);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PPC_I8259 */
|
|
||||||
|
|
||||||
void __init mpc85xx_ds_pic_init(void)
|
static void __init mpc85xx_8259_init(void)
|
||||||
{
|
{
|
||||||
struct mpic *mpic;
|
|
||||||
int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU;
|
|
||||||
#ifdef CONFIG_PPC_I8259
|
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
struct device_node *cascade_node = NULL;
|
struct device_node *cascade_node = NULL;
|
||||||
int cascade_irq;
|
int cascade_irq;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (of_machine_is_compatible("fsl,MPC8572DS-CAMP"))
|
if (!IS_ENABLED(CONFIG_PPC_I8259))
|
||||||
flags |= MPIC_NO_RESET;
|
|
||||||
|
|
||||||
mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
|
|
||||||
|
|
||||||
if (WARN_ON(!mpic))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mpic_init(mpic);
|
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_I8259
|
|
||||||
/* Initialize the i8259 controller */
|
/* Initialize the i8259 controller */
|
||||||
for_each_node_by_type(np, "interrupt-controller")
|
for_each_node_by_type(np, "interrupt-controller")
|
||||||
if (of_device_is_compatible(np, "chrp,iic")) {
|
if (of_device_is_compatible(np, "chrp,iic")) {
|
||||||
@ -92,7 +78,24 @@ void __init mpc85xx_ds_pic_init(void)
|
|||||||
of_node_put(cascade_node);
|
of_node_put(cascade_node);
|
||||||
|
|
||||||
irq_set_chained_handler(cascade_irq, mpc85xx_8259_cascade);
|
irq_set_chained_handler(cascade_irq, mpc85xx_8259_cascade);
|
||||||
#endif /* CONFIG_PPC_I8259 */
|
}
|
||||||
|
|
||||||
|
void __init mpc85xx_ds_pic_init(void)
|
||||||
|
{
|
||||||
|
struct mpic *mpic;
|
||||||
|
int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU;
|
||||||
|
|
||||||
|
if (of_machine_is_compatible("fsl,MPC8572DS-CAMP"))
|
||||||
|
flags |= MPIC_NO_RESET;
|
||||||
|
|
||||||
|
mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
|
||||||
|
|
||||||
|
if (WARN_ON(!mpic))
|
||||||
|
return;
|
||||||
|
|
||||||
|
mpic_init(mpic);
|
||||||
|
|
||||||
|
mpc85xx_8259_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user