Do we still need devtree_lock?

Timur Tabi timur at freescale.com
Wed Jun 25 09:13:40 EST 2008


I'm trying to write a function that gets a list of all aliases

	aliases {
		serial0 = &serial0;
		serial1 = &serial1;
		pci0 = &pci0;
		pci1 = &pci1;
		pci2 = &pci2;
	};

That is, I do not know which aliases are in the /aliases node, so I need a
function that works somewhat like of_find_property(), but just returns the Nth
property instead of doing a strcmp.

I can't seem to find one, so I probably need to write one.  However, I noticed
that of_find_property() uses a lock:

	read_lock(&devtree_lock);
	for (pp = np->properties; pp != 0; pp = pp->next) {
		if (of_prop_cmp(pp->name, name) == 0) {
			if (lenp != 0)
				*lenp = pp->length;
			break;
		}
	}
	read_unlock(&devtree_lock);

But the comment for devtree_lock says this:

extern rwlock_t devtree_lock;	/* temporary while merging */

Since arch/ppc is going away, does this meant that the lock can go away do?

-- 
Timur Tabi
Linux kernel developer at Freescale



More information about the Linuxppc-dev mailing list