* [PATCH] gpio: Drop the chained IRQ handler assign function
@ 2020-01-13 22:08 Linus Walleij
2020-01-15 22:45 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2020-01-13 22:08 UTC (permalink / raw)
To: linux-gpio; +Cc: Bartosz Golaszewski, Linus Walleij, Andy Shevchenko
gpiochip_set_chained_irqchip() would assign a chained handler
to a GPIO chip. We now populate struct gpio_irq_chip for all
chained GPIO irqchips so drop this function.
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
This requires me to pull in the Intel pinctrl changes that
are pending first, but once there we can do this.
---
Documentation/driver-api/gpio/driver.rst | 5 -----
drivers/gpio/gpio-mt7621.c | 3 +--
drivers/gpio/gpio-xgs-iproc.c | 3 +--
drivers/gpio/gpiolib.c | 25 +-----------------------
include/linux/gpio/driver.h | 5 -----
5 files changed, 3 insertions(+), 38 deletions(-)
diff --git a/Documentation/driver-api/gpio/driver.rst b/Documentation/driver-api/gpio/driver.rst
index 2ff743105927..871922529332 100644
--- a/Documentation/driver-api/gpio/driver.rst
+++ b/Documentation/driver-api/gpio/driver.rst
@@ -507,11 +507,6 @@ available but we try to move away from this:
cascaded irq has to be handled by a threaded interrupt handler.
Apart from that it works exactly like the chained irqchip.
-- DEPRECATED: gpiochip_set_chained_irqchip(): sets up a chained cascaded irq
- handler for a gpio_chip from a parent IRQ and passes the struct gpio_chip*
- as handler data. Notice that we pass is as the handler data, since the
- irqchip data is likely used by the parent irqchip.
-
- gpiochip_set_nested_irqchip(): sets up a nested cascaded irq handler for a
gpio_chip from a parent IRQ. As the parent IRQ has usually been
explicitly requested by the driver, this does very little more than
diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index d1d785f983a7..b992321bb852 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -253,8 +253,7 @@ mediatek_gpio_bank_probe(struct device *dev,
/*
* Directly request the irq here instead of passing
- * a flow-handler to gpiochip_set_chained_irqchip,
- * because the irq is shared.
+ * a flow-handler because the irq is shared.
*/
ret = devm_request_irq(dev, mtk->gpio_irq,
mediatek_gpio_irq_handler, IRQF_SHARED,
diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c
index b21c2e436b61..ad5489a65d54 100644
--- a/drivers/gpio/gpio-xgs-iproc.c
+++ b/drivers/gpio/gpio-xgs-iproc.c
@@ -251,8 +251,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
/*
* Directly request the irq here instead of passing
- * a flow-handler to gpiochip_set_chained_irqchip,
- * because the irq is shared.
+ * a flow-handler because the irq is shared.
*/
ret = devm_request_irq(dev, irq, iproc_gpio_irq_handler,
IRQF_SHARED, chip->gc.label, &chip->gc);
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 967371377a9d..ce9724d341f5 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1800,7 +1800,7 @@ EXPORT_SYMBOL_GPL(gpiochip_irqchip_irq_valid);
* gpiochip_set_cascaded_irqchip() - connects a cascaded irqchip to a gpiochip
* @gc: the gpiochip to set the irqchip chain to
* @parent_irq: the irq number corresponding to the parent IRQ for this
- * chained irqchip
+ * cascaded irqchip
* @parent_handler: the parent interrupt handler for the accumulated IRQ
* coming out of the gpiochip. If the interrupt is nested rather than
* cascaded, pass NULL in this handler argument
@@ -1842,29 +1842,6 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gc,
}
}
-/**
- * gpiochip_set_chained_irqchip() - connects a chained irqchip to a gpiochip
- * @gpiochip: the gpiochip to set the irqchip chain to
- * @irqchip: the irqchip to chain to the gpiochip
- * @parent_irq: the irq number corresponding to the parent IRQ for this
- * chained irqchip
- * @parent_handler: the parent interrupt handler for the accumulated IRQ
- * coming out of the gpiochip.
- */
-void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
- struct irq_chip *irqchip,
- unsigned int parent_irq,
- irq_flow_handler_t parent_handler)
-{
- if (gpiochip->irq.threaded) {
- chip_err(gpiochip, "tried to chain a threaded gpiochip\n");
- return;
- }
-
- gpiochip_set_cascaded_irqchip(gpiochip, parent_irq, parent_handler);
-}
-EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip);
-
/**
* gpiochip_set_nested_irqchip() - connects a nested irqchip to a gpiochip
* @gpiochip: the gpiochip to set the irqchip nested handler to
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 4f032de10bae..e829ad788987 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -585,11 +585,6 @@ int gpiochip_irq_domain_activate(struct irq_domain *domain,
void gpiochip_irq_domain_deactivate(struct irq_domain *domain,
struct irq_data *data);
-void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
- struct irq_chip *irqchip,
- unsigned int parent_irq,
- irq_flow_handler_t parent_handler);
-
void gpiochip_set_nested_irqchip(struct gpio_chip *gpiochip,
struct irq_chip *irqchip,
unsigned int parent_irq);
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: Drop the chained IRQ handler assign function
2020-01-13 22:08 [PATCH] gpio: Drop the chained IRQ handler assign function Linus Walleij
@ 2020-01-15 22:45 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2020-01-15 22:45 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, Bartosz Golaszewski
On Mon, Jan 13, 2020 at 11:08:00PM +0100, Linus Walleij wrote:
> gpiochip_set_chained_irqchip() would assign a chained handler
> to a GPIO chip. We now populate struct gpio_irq_chip for all
> chained GPIO irqchips so drop this function.
>
Good for me!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> This requires me to pull in the Intel pinctrl changes that
> are pending first, but once there we can do this.
We are going to send them next Monday / Tuesday I suppose.
> ---
> Documentation/driver-api/gpio/driver.rst | 5 -----
> drivers/gpio/gpio-mt7621.c | 3 +--
> drivers/gpio/gpio-xgs-iproc.c | 3 +--
> drivers/gpio/gpiolib.c | 25 +-----------------------
> include/linux/gpio/driver.h | 5 -----
> 5 files changed, 3 insertions(+), 38 deletions(-)
>
> diff --git a/Documentation/driver-api/gpio/driver.rst b/Documentation/driver-api/gpio/driver.rst
> index 2ff743105927..871922529332 100644
> --- a/Documentation/driver-api/gpio/driver.rst
> +++ b/Documentation/driver-api/gpio/driver.rst
> @@ -507,11 +507,6 @@ available but we try to move away from this:
> cascaded irq has to be handled by a threaded interrupt handler.
> Apart from that it works exactly like the chained irqchip.
>
> -- DEPRECATED: gpiochip_set_chained_irqchip(): sets up a chained cascaded irq
> - handler for a gpio_chip from a parent IRQ and passes the struct gpio_chip*
> - as handler data. Notice that we pass is as the handler data, since the
> - irqchip data is likely used by the parent irqchip.
> -
> - gpiochip_set_nested_irqchip(): sets up a nested cascaded irq handler for a
> gpio_chip from a parent IRQ. As the parent IRQ has usually been
> explicitly requested by the driver, this does very little more than
> diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
> index d1d785f983a7..b992321bb852 100644
> --- a/drivers/gpio/gpio-mt7621.c
> +++ b/drivers/gpio/gpio-mt7621.c
> @@ -253,8 +253,7 @@ mediatek_gpio_bank_probe(struct device *dev,
>
> /*
> * Directly request the irq here instead of passing
> - * a flow-handler to gpiochip_set_chained_irqchip,
> - * because the irq is shared.
> + * a flow-handler because the irq is shared.
> */
> ret = devm_request_irq(dev, mtk->gpio_irq,
> mediatek_gpio_irq_handler, IRQF_SHARED,
> diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c
> index b21c2e436b61..ad5489a65d54 100644
> --- a/drivers/gpio/gpio-xgs-iproc.c
> +++ b/drivers/gpio/gpio-xgs-iproc.c
> @@ -251,8 +251,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
>
> /*
> * Directly request the irq here instead of passing
> - * a flow-handler to gpiochip_set_chained_irqchip,
> - * because the irq is shared.
> + * a flow-handler because the irq is shared.
> */
> ret = devm_request_irq(dev, irq, iproc_gpio_irq_handler,
> IRQF_SHARED, chip->gc.label, &chip->gc);
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 967371377a9d..ce9724d341f5 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1800,7 +1800,7 @@ EXPORT_SYMBOL_GPL(gpiochip_irqchip_irq_valid);
> * gpiochip_set_cascaded_irqchip() - connects a cascaded irqchip to a gpiochip
> * @gc: the gpiochip to set the irqchip chain to
> * @parent_irq: the irq number corresponding to the parent IRQ for this
> - * chained irqchip
> + * cascaded irqchip
> * @parent_handler: the parent interrupt handler for the accumulated IRQ
> * coming out of the gpiochip. If the interrupt is nested rather than
> * cascaded, pass NULL in this handler argument
> @@ -1842,29 +1842,6 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gc,
> }
> }
>
> -/**
> - * gpiochip_set_chained_irqchip() - connects a chained irqchip to a gpiochip
> - * @gpiochip: the gpiochip to set the irqchip chain to
> - * @irqchip: the irqchip to chain to the gpiochip
> - * @parent_irq: the irq number corresponding to the parent IRQ for this
> - * chained irqchip
> - * @parent_handler: the parent interrupt handler for the accumulated IRQ
> - * coming out of the gpiochip.
> - */
> -void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
> - struct irq_chip *irqchip,
> - unsigned int parent_irq,
> - irq_flow_handler_t parent_handler)
> -{
> - if (gpiochip->irq.threaded) {
> - chip_err(gpiochip, "tried to chain a threaded gpiochip\n");
> - return;
> - }
> -
> - gpiochip_set_cascaded_irqchip(gpiochip, parent_irq, parent_handler);
> -}
> -EXPORT_SYMBOL_GPL(gpiochip_set_chained_irqchip);
> -
> /**
> * gpiochip_set_nested_irqchip() - connects a nested irqchip to a gpiochip
> * @gpiochip: the gpiochip to set the irqchip nested handler to
> diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
> index 4f032de10bae..e829ad788987 100644
> --- a/include/linux/gpio/driver.h
> +++ b/include/linux/gpio/driver.h
> @@ -585,11 +585,6 @@ int gpiochip_irq_domain_activate(struct irq_domain *domain,
> void gpiochip_irq_domain_deactivate(struct irq_domain *domain,
> struct irq_data *data);
>
> -void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
> - struct irq_chip *irqchip,
> - unsigned int parent_irq,
> - irq_flow_handler_t parent_handler);
> -
> void gpiochip_set_nested_irqchip(struct gpio_chip *gpiochip,
> struct irq_chip *irqchip,
> unsigned int parent_irq);
> --
> 2.23.0
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-15 22:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 22:08 [PATCH] gpio: Drop the chained IRQ handler assign function Linus Walleij
2020-01-15 22:45 ` Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.