]> git.karo-electronics.de Git - karo-tx-uboot.git/commit
dm: core: Match compatible strings in order of priority
authorPaul Burton <paul.burton@imgtec.com>
Thu, 8 Sep 2016 06:47:36 +0000 (07:47 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 21 Sep 2016 13:04:32 +0000 (15:04 +0200)
commitce701721596618afc0affc50f1708ece156891f9
tree083c24aed43a6599bfa2dc21223b89e584275565
parent3bfb8cb43b16aeac138dbdbc1311cd718bbc4066
dm: core: Match compatible strings in order of priority

Device model drivers have previously been matched to FDT nodes by virtue
of being the first driver in the driver list to be compatible with the
node. This ignores the fact that compatible strings in the device tree
are listed in order of priority - that is, if we have a node with 2
compatible strings & a driver that matches each then we should always
probe the driver that matches the first compatible string.

Fix this by looping through the compatible strings for a node when
attempting to bind it in lists_bind_fdt and checking each driver for
a match of the first string, then each driver for a match of the second
string etc. Effectively this inverts the loops over compatible strings &
drivers.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
drivers/core/lists.c