Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: sifive: Set affinity callback to parent

This assigns the .irq_set_affinity to the parent callback.
I assume the sifive GPIO can be used in systems with
SMP.

I used the pattern making the hirerarchy tolerant for missing
parent as in Marc's earlier patches.

Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Yash Shah <yash.shah@sifive.com>
Cc: Wesley W. Terpstra <wesley@sifive.com>
Link: https://lore.kernel.org/r/20201117213351.249668-1-linus.walleij@linaro.org

+11
+11
drivers/gpio/gpio-sifive.c
··· 128 128 irq_chip_eoi_parent(d); 129 129 } 130 130 131 + static int sifive_gpio_irq_set_affinity(struct irq_data *data, 132 + const struct cpumask *dest, 133 + bool force) 134 + { 135 + if (data->parent_data) 136 + return irq_chip_set_affinity_parent(data, dest, force); 137 + 138 + return -EINVAL; 139 + } 140 + 131 141 static struct irq_chip sifive_gpio_irqchip = { 132 142 .name = "sifive-gpio", 133 143 .irq_set_type = sifive_gpio_irq_set_type, ··· 146 136 .irq_enable = sifive_gpio_irq_enable, 147 137 .irq_disable = sifive_gpio_irq_disable, 148 138 .irq_eoi = sifive_gpio_irq_eoi, 139 + .irq_set_affinity = sifive_gpio_irq_set_affinity, 149 140 }; 150 141 151 142 static int sifive_gpio_child_to_parent_hwirq(struct gpio_chip *gc,