lkml.org 
[lkml]   [2022]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] gpio: Remove dynamic allocation from populate_parent_alloc_arg()
Hi March,

On Fri, 13 May 2022 at 01:23, Marc Zyngier <maz@kernel.org> wrote:
> diff --git a/drivers/gpio/gpio-msc313.c b/drivers/gpio/gpio-msc313.c
> index b2c90bdd39d0..52d7b8d99170 100644
> --- a/drivers/gpio/gpio-msc313.c
> +++ b/drivers/gpio/gpio-msc313.c
> @@ -550,15 +550,12 @@ static struct irq_chip msc313_gpio_irqchip = {
> * so we need to provide the fwspec. Essentially gpiochip_populate_parent_fwspec_twocell
> * that puts GIC_SPI into the first cell.
> */
> -static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
> - unsigned int parent_hwirq,
> - unsigned int parent_type)
> +static int msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
> + union gpio_irq_fwspec *gfwspec,
> + unsigned int parent_hwirq,
> + unsigned int parent_type)
> {
> - struct irq_fwspec *fwspec;
> -
> - fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
> - if (!fwspec)
> - return NULL;
> + struct irq_fwspec *fwspec = &gfwspec->fwspec;
>
> fwspec->fwnode = gc->irq.parent_domain->fwnode;
> fwspec->param_count = 3;
> @@ -566,7 +563,7 @@ static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
> fwspec->param[1] = parent_hwirq;
> fwspec->param[2] = parent_type;
>
> - return fwspec;
> + return 0;
> }
>
> static int msc313e_gpio_child_to_parent_hwirq(struct gpio_chip *chip,

This bit looks fine to me. I will test it over the weekend.

Cheers,

Daniel

\
 
 \ /
  Last update: 2022-05-13 13:16    [W:0.082 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site