Patch "gpio: Add helpers to ease the transition towards immutable irq_chip" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    gpio: Add helpers to ease the transition towards immutable irq_chip

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gpio-add-helpers-to-ease-the-transition-towards-immu.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 648511402a487ae3bc6b1ddcb752a4c959ee7db4
Author: Marc Zyngier <maz@xxxxxxxxxx>
Date:   Tue Apr 19 15:18:39 2022 +0100

    gpio: Add helpers to ease the transition towards immutable irq_chip
    
    [ Upstream commit 36b78aae4bfee749bbde73be570796bfd0f56bec ]
    
    Add a couple of new helpers to make it slightly simpler to convert
    drivers to immutable irq_chip structures:
    
    - GPIOCHIP_IRQ_RESOURCE_HELPERS populates the irq_chip structure
      with the resource management callbacks
    
    - gpio_irq_chip_set_chip() populates the gpio_irq_chip.chip
      structure, avoiding the proliferation of ugly casts
    
    Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
    Reviewed-by: Bartosz Golaszewski <brgl@xxxxxxxx>
    Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220419141846.598305-4-maz@xxxxxxxxxx
    Stable-dep-of: dc3115e6c5d9 ("hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index b241fc23ff3a2..91f60d1e3eb31 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -599,6 +599,18 @@ void gpiochip_enable_irq(struct gpio_chip *gc, unsigned int offset);
 int gpiochip_irq_reqres(struct irq_data *data);
 void gpiochip_irq_relres(struct irq_data *data);
 
+/* Paste this in your irq_chip structure  */
+#define	GPIOCHIP_IRQ_RESOURCE_HELPERS					\
+		.irq_request_resources  = gpiochip_irq_reqres,		\
+		.irq_release_resources  = gpiochip_irq_relres
+
+static inline void gpio_irq_chip_set_chip(struct gpio_irq_chip *girq,
+					  const struct irq_chip *chip)
+{
+	/* Yes, dropping const is ugly, but it isn't like we have a choice */
+	girq->chip = (struct irq_chip *)chip;
+}
+
 /* Line status inquiry for drivers */
 bool gpiochip_line_is_open_drain(struct gpio_chip *gc, unsigned int offset);
 bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux