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

Commit 6016a363 authored by Grant Likely's avatar Grant Likely
Browse files

of: unify phandle name in struct device_node



In struct device_node, the phandle is named 'linux_phandle' for PowerPC
and MicroBlaze, and 'node' for SPARC.  There is no good reason for the
difference, it is just an artifact of the code diverging over a couple
of years.  This patch renames both to simply .phandle.

Note: the .node also existed in PowerPC/MicroBlaze, but the only user
seems to be arch/powerpc/platforms/powermac/pfunc_core.c.  It doesn't
look like the assignment between .linux_phandle and .node is
significantly different enough to warrant the separate code paths
unless ibm,phandle properties actually appear in Apple device trees.

I think it is safe to eliminate the old .node property and use
phandle everywhere.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Tested-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 923f7e30
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
static int of_dev_phandle_match(struct device *dev, void *data)
{
	phandle *ph = data;
	return to_of_device(dev)->node->linux_phandle == *ph;
	return to_of_device(dev)->node->phandle == *ph;
}

struct of_device *of_find_device_by_phandle(phandle ph)
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)

	read_lock(&devtree_lock);
	for (np = allnodes; np != NULL; np = np->allnext)
		if (np->linux_phandle == handle)
		if (np->phandle == handle)
			break;
	of_node_get(np);
	read_unlock(&devtree_lock);
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
static int of_dev_phandle_match(struct device *dev, void *data)
{
	phandle *ph = data;
	return to_of_device(dev)->node->linux_phandle == *ph;
	return to_of_device(dev)->node->phandle == *ph;
}

struct of_device *of_find_device_by_phandle(phandle ph)
+3 −3
Original line number Diff line number Diff line
@@ -778,7 +778,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)

	read_lock(&devtree_lock);
	for (np = allnodes; np != 0; np = np->allnext)
		if (np->linux_phandle == handle)
		if (np->phandle == handle)
			break;
	of_node_get(np);
	read_unlock(&devtree_lock);
@@ -907,9 +907,9 @@ static int of_finish_dynamic_node(struct device_node *node)
	if (machine_is(powermac))
		return -ENODEV;

	/* fix up new node's linux_phandle field */
	/* fix up new node's phandle field */
	if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL)))
		node->linux_phandle = *ibm_phandle;
		node->phandle = *ibm_phandle;

out:
	of_node_put(parent);
+3 −3
Original line number Diff line number Diff line
@@ -457,7 +457,7 @@ neighbour_spu(int cbe, struct device_node *target, struct device_node *avoid)
			continue;
		vic_handles = of_get_property(spu_dn, "vicinity", &lenp);
		for (i=0; i < (lenp / sizeof(phandle)); i++) {
			if (vic_handles[i] == target->linux_phandle)
			if (vic_handles[i] == target->phandle)
				return spu;
		}
	}
@@ -499,7 +499,7 @@ static void init_affinity_node(int cbe)

			if (strcmp(name, "spe") == 0) {
				spu = devnode_spu(cbe, vic_dn);
				avoid_ph = last_spu_dn->linux_phandle;
				avoid_ph = last_spu_dn->phandle;
			} else {
				/*
				 * "mic-tm" and "bif0" nodes do not have
@@ -514,7 +514,7 @@ static void init_affinity_node(int cbe)
					last_spu->has_mem_affinity = 1;
					spu->has_mem_affinity = 1;
				}
				avoid_ph = vic_dn->linux_phandle;
				avoid_ph = vic_dn->phandle;
			}

			list_add_tail(&spu->aff_list, &last_spu->aff_list);
Loading