Re: [PATCH v2 10/10] Documentation: Update the recommended pattern for GPIO irqchips

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

 



On Wed, Apr 6, 2022 at 1:57 PM Marc Zyngier <maz@xxxxxxxxxx> wrote:
>
> Update the documentation to get rid of the per-gpio_irq_chip
> irq_chip structure, and give examples of the new pattern.

...

> +  static void my_gpio_mask_irq(struct irq_data *d)
> +  {
> +      struct gpio_chip *gc = irq_desc_get_handler_data(d);
> +
> +      /*
> +       * Perform any necessary action to mask the interrupt,
> +       * and then call into the core code to synchronise the
> +       * state.
> +       */
> +
> +      gpiochip_disable_irq(gc, d->hwirq);

(1)

> +  }
> +
> +  static void my_gpio_unmask_irq(struct irq_data *d)
> +  {
> +      struct gpio_chip *gc = irq_desc_get_handler_data(d);

> +      gpiochip_disable_irq(gc, d->hwirq);

(2)

> +      /*
> +       * Perform any necessary action to unmask the interrupt,
> +       * after having called into the core code to synchronise
> +       * the state.
> +       */
> +  }

If (1) and (2) being the same is not a mistake (typo) it probably
needs additional explanation.

...

> +  static void my_gpio_mask_irq(struct irq_data *d)
> +  {
> +      struct gpio_chip *gc = irq_desc_get_handler_data(d);
> +
> +      /*
> +       * Perform any necessary action to mask the interrupt,
> +       * and then call into the core code to synchronise the
> +       * state.
> +       */

> +      gpiochip_disable_irq(gc, d->hwirq);

(3)

> +  }
> +
> +  static void my_gpio_unmask_irq(struct irq_data *d)
> +  {
> +      struct gpio_chip *gc = irq_desc_get_handler_data(d);

> +      gpiochip_disable_irq(gc, d->hwirq);

(4)

> +      /*
> +       * Perform any necessary action to unmask the interrupt,
> +       * after having called into the core code to synchronise
> +       * the state.
> +       */
> +  }

Ditto for (3) & (4).

...

> +  static void my_gpio_mask_irq(struct irq_data *d)
> +  {
> +      struct gpio_chip *gc = irq_desc_get_handler_data(d);
> +
> +      /*
> +       * Perform any necessary action to mask the interrupt,
> +       * and then call into the core code to synchronise the
> +       * state.
> +       */
> +
> +      gpiochip_disable_irq(gc, d->hwirq);

(5)

> +      irq_mask_mask_parent(d);
> +  }
> +
> +  static void my_gpio_unmask_irq(struct irq_data *d)
> +  {
> +      struct gpio_chip *gc = irq_desc_get_handler_data(d);

> +      gpiochip_disable_irq(gc, d->hwirq);

(6)

> +      /*
> +       * Perform any necessary action to unmask the interrupt,
> +       * after having called into the core code to synchronise
> +       * the state.
> +       */
> +
> +      irq_mask_unmask_parent(d);
> +  }

Ditto for (5) & (6).

--
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux