WSL2-Linux-Kernel/drivers/of
Andres Salomon a74ea43df1 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>
2011-03-02 13:45:19 -07:00
..
Kconfig of/flattree: Add Kconfig for EARLY_FLATTREE 2010-12-29 16:08:18 -07:00
Makefile of/net: Move of_get_mac_address() to a common source file. 2010-11-01 01:08:14 -04:00
address.c of/address: use proper endianess in get_flags 2010-12-23 15:57:48 -07:00
base.c of: use __be32 types for big-endian device tree data 2010-10-12 21:58:42 -06:00
device.c of/device: Rework to use common platform_device_alloc() for allocating devices 2010-10-21 11:10:10 -06:00
fdt.c dt/flattree: Return virtual address from early_init_dt_alloc_memory_arch() 2011-01-15 22:01:58 -07:00
gpio.c of/gpio: fix of_gpio includes 2010-07-05 16:14:44 -06:00
irq.c of/irq: remove references to NO_IRQ in drivers/of/platform.c 2010-10-12 21:58:27 -06:00
of_i2c.c of/i2c: Fix request module by alias 2010-12-24 01:28:54 -07:00
of_mdio.c of/mdio: Fix some endianness problems. 2010-12-24 01:25:54 -07:00
of_net.c of/net: Move of_get_mac_address() to a common source file. 2010-11-01 01:08:14 -04:00
of_spi.c of/spi: call of_register_spi_devices() from spi core code 2010-07-30 00:03:59 -06:00
pdt.c of/promtree: allow DT device matching by fixing 'name' brokenness (v5) 2011-03-02 13:45:19 -07:00
platform.c of/device: Don't register disabled devices 2011-01-03 16:02:49 -07:00