I initially submitted patch 2/3 as a standalone, but it turned out during some development for iio that some additional functionalities would be useful as well.
The first patch pulls in slab.h directly instead of relying on the include from irq.h. The second exposes an interface for accessing the base of the allocated interrupt range. The third implements a function that allows to map the allocated interrupt number to the array offset within the irq sim object. This will be later (4.16) used in iio, where for 4.15 we needed to keep the irq base value and to calculate the offset manually in the driver. Bartosz Golaszewski (3): irq/irq_sim: explicitly pull in slab.h irq/irq_sim: implement irq_sim_baseirq() irq/irq_sim: implement irq_sim_irq2offset() include/linux/irq_sim.h | 2 ++ kernel/irq/irq_sim.c | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) -- 2.13.2