Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 996983b7 authored by Kyle Moffett's avatar Kyle Moffett Committed by Benjamin Herrenschmidt
Browse files

powerpc/mpic: Search for open-pic device-tree node if NULL



Almost all PowerPC platforms use a standard "open-pic" device node so
the mpic_alloc() function now accepts NULL for the device-node.  This
will cause it to perform a default search with of_find_matching_node().

Signed-off-by: default avatarKyle Moffett <Kyle.D.Moffett@boeing.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent e7a98675
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -36,21 +36,13 @@
void __init corenet_ds_pic_init(void)
{
	struct mpic *mpic;
	struct device_node *np = NULL;
	unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN |
				MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU;

	np = of_find_node_by_type(np, "open-pic");

	if (np == NULL) {
		printk(KERN_ERR "Could not find open-pic node\n");
		return;
	}

	if (ppc_md.get_irq == mpic_get_coreint_irq)
		flags |= MPIC_ENABLE_COREINT;

	mpic = mpic_alloc(np, 0, flags, 0, 256, " OpenPIC  ");
	mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC  ");
	BUG_ON(mpic == NULL);

	mpic_init(mpic);
+1 −13
Original line number Diff line number Diff line
@@ -57,22 +57,10 @@ static void machine_restart(char *cmd)

static void __init ksi8560_pic_init(void)
{
	struct mpic *mpic;
	struct device_node *np;

	np = of_find_node_by_type(NULL, "open-pic");

	if (np == NULL) {
		printk(KERN_ERR "Could not find open-pic node\n");
		return;
	}

	mpic = mpic_alloc(np, 0,
	struct mpic *mpic = mpic_alloc(NULL, 0,
			MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
			0, 256, " OpenPIC  ");
	BUG_ON(mpic == NULL);
	of_node_put(np);

	mpic_init(mpic);

	mpc85xx_cpm2_pic_init();
+1 −12
Original line number Diff line number Diff line
@@ -36,22 +36,11 @@

void __init mpc8536_ds_pic_init(void)
{
	struct mpic *mpic;
	struct device_node *np;

	np = of_find_node_by_type(NULL, "open-pic");
	if (np == NULL) {
		printk(KERN_ERR "Could not find open-pic node\n");
		return;
	}

	mpic = mpic_alloc(np, 0,
	struct mpic *mpic = mpic_alloc(NULL, 0,
			  MPIC_PRIMARY | MPIC_WANTS_RESET |
			  MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
			0, 256, " OpenPIC  ");
	BUG_ON(mpic == NULL);
	of_node_put(np);

	mpic_init(mpic);
}

+1 −12
Original line number Diff line number Diff line
@@ -50,21 +50,10 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,

static void __init mpc85xx_ads_pic_init(void)
{
	struct mpic *mpic;
	struct device_node *np = NULL;

	np = of_find_node_by_type(np, "open-pic");
	if (!np) {
		printk(KERN_ERR "Could not find open-pic node\n");
		return;
	}

	mpic = mpic_alloc(np, 0,
	struct mpic *mpic = mpic_alloc(NULL, 0,
			MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
			0, 256, " OpenPIC  ");
	BUG_ON(mpic == NULL);
	of_node_put(np);

	mpic_init(mpic);

	mpc85xx_cpm2_pic_init();
+1 −14
Original line number Diff line number Diff line
@@ -188,23 +188,10 @@ static struct irqaction mpc85xxcds_8259_irqaction = {
static void __init mpc85xx_cds_pic_init(void)
{
	struct mpic *mpic;
	struct device_node *np = NULL;

	np = of_find_node_by_type(np, "open-pic");

	if (np == NULL) {
		printk(KERN_ERR "Could not find open-pic node\n");
		return;
	}

	mpic = mpic_alloc(np, 0,
	mpic = mpic_alloc(NULL, 0,
			MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
			0, 256, " OpenPIC  ");
	BUG_ON(mpic == NULL);

	/* Return the mpic node */
	of_node_put(np);

	mpic_init(mpic);
}

Loading