From c9606079a5cc589fb90fa7e8f4be142f0ccc847b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jun 2023 12:44:51 +0000 Subject: [PATCH] Revert "gpio: Allow per-parent interrupt data" This reverts commit 304802e5b038e9e33e1b7fe5f933864e7a8e0ec1 which is commit cfe6807d82e97e81c3209dca9448f091e1448a57 upstream. It breaks the Android api, so revert it for now. If it needs to come back, it can do so in an abi-safe way. Bug: 161946584 Change-Id: I0f1f7b4de721ff23d252eef9b55678c3b6053cb7 Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpiolib.c | 9 ++------- include/linux/gpio/driver.h | 19 ++----------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 4dd37457948c..e885218fb0c6 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1596,14 +1596,9 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, } if (gc->irq.parent_handler) { + void *data = gc->irq.parent_handler_data ?: gc; + for (i = 0; i < gc->irq.num_parents; i++) { - void *data; - - if (gc->irq.per_parent_data) - data = gc->irq.parent_handler_data_array[i]; - else - data = gc->irq.parent_handler_data ?: gc; - /* * The parent IRQ chip is already using the chip_data * for this IRQ chip, so our callbacks simply use the diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 6f573ca2a98f..c5585bcf53a5 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -169,18 +169,11 @@ struct gpio_irq_chip { /** * @parent_handler_data: - * @parent_handler_data_array: * * Data associated, and passed to, the handler for the parent - * interrupt. Can either be a single pointer if @per_parent_data - * is false, or an array of @num_parents pointers otherwise. If - * @per_parent_data is true, @parent_handler_data_array cannot be - * NULL. + * interrupt. */ - union { - void *parent_handler_data; - void **parent_handler_data_array; - }; + void *parent_handler_data; /** * @num_parents: @@ -211,14 +204,6 @@ struct gpio_irq_chip { */ bool threaded; - /** - * @per_parent_data: - * - * True if parent_handler_data_array describes a @num_parents - * sized array to be used as parent data. - */ - bool per_parent_data; - /** * @init_hw: optional routine to initialize hardware before * an IRQ chip will be added. This is quite useful when