xen: dt: add dt_for_each_irq_map helper
authorIan Campbell <ian.campbell@citrix.com>
Tue, 7 Jul 2015 08:46:13 +0000 (09:46 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 7 Jul 2015 14:10:44 +0000 (15:10 +0100)
commit5cefb30c862225ba5e83b708fedc9230b1e53e81
tree0a2d2ab68290bbba934fab0c88c3ae20e7ed9a63
parentd7f132c762d1359f03b2b5b89406daf39d8aefc0
xen: dt: add dt_for_each_irq_map helper

This function iterates over a nodes interrupt-map property and calls a
callback for each interrupt. For now it only supplies the translated
IRQ since my use case has no need of e.g. child unit address. These
can be added as needed by any future users.

This follows much the same logic as dt_irq_map_raw when parsing the
interrupt-map, but doesn't walk up the tree doing the actual
translation and it iterates over all entries instead of just looking
for the first match.

I looked into refactoring dt_irq_map_raw but I couldn't find a way
which I was confident in, plus I was reluctant to diverge from the
Linux roots of this function any further.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@citrix.com>
xen/common/device_tree.c
xen/include/xen/device_tree.h