]> git.karo-electronics.de Git - mv-sheeva.git/commit
of/promtree: allow DT device matching by fixing 'name' brokenness (v5)
authorAndres Salomon <dilinger@queued.net>
Thu, 24 Feb 2011 06:38:22 +0000 (22:38 -0800)
committerGrant Likely <grant.likely@secretlab.ca>
Wed, 2 Mar 2011 20:45:19 +0000 (13:45 -0700)
commita74ea43df1afc68f265c0ac2cb64031d855ae97b
tree7e3b00d2493bd19c408df10a55daf111375c9104
parent60cba5a57b8affe98ea9f2bac147be0fb253d5f4
of/promtree: allow DT device matching by fixing 'name' brokenness (v5)

Commit e2f2a93b, "of/promtree: add package-to-path support to pdt"
changed dp->name from using the 'name' property to using
package-to-path.  This fixed /proc/device-tree creation by eliminating
conflicts between names (the 'name' property provides names like
'battery', whereas package-to-path provides names like
'/foo/bar/battery@0', which we stripped to 'battery@0').  However, it
also breaks of_device_id table matching.

The fix that we _really_ wanted was to keep dp->name based upon
the name property ('battery'), but based dp->full_name upon
package-to-path ('battery@0').  This patch does just that.

This changes all users (except SPARC) of promtree to use the full
result from package-to-path for full_name, rather than stripping the
directory out.  In practice, the strings end up being exactly the
same; this change saves time, code, and memory.

SPARC continues to use the existing build_path_component() code.

v2: combine two patches and revert of_pdt_node_name to original version
v3: use dp->phandle instead of passing around node
v4: warn/bail out for non-sparc archs if pkg2path is not set
v5: split of_pdt_build_full_name into sparc & non-sparc versions
v6: Pass NULL to pkg2path before buf gets assigned.
    Drop check for pkg2path hook on each and every node.
v7: Don't BUG() when unable to get the full_path; create a
    known-unique name instead.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/of/pdt.c