spmi: pmic-arb: optimize table lookups
authorAbhijeet Dharmapurikar <adharmap@codeaurora.org>
Wed, 10 May 2017 14:25:34 +0000 (19:55 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Jun 2017 10:05:47 +0000 (19:05 +0900)
commit7f1d4e58dabb2668dd89547619ae4138996a8e26
tree27e9b91d48449ad2b555a890cfec992a02857aea
parent1ef1ce4e9ddd6dedd80f64ef112a3bd87ab50530
spmi: pmic-arb: optimize table lookups

The current driver uses a mix of radix tree and a fwd lookup
table to translate between apid and ppid. It is buggy and confusing.

Instead simply use a radix tree for v1 hardware and use the
forward lookup table for v2.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spmi/spmi-pmic-arb.c