lkml.org 
[lkml]   [2022]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4/7] irqchip/stm32-exti: forward irq_request_resources to parent
    On Tue, 10 May 2022 17:41:20 +0100,
    Antonio Borneo <antonio.borneo@foss.st.com> wrote:
    >
    > From: Pascal Paillet <p.paillet@foss.st.com>
    >
    > Enhance stm32-exti driver to forward request_resources and
    > release_resources_parent operations to parent.
    > Do not use irq_request_resources_parent because it returns
    > an error when the parent does not implement irq_request_resources.
    >
    > Signed-off-by: Pascal Paillet <p.paillet@foss.st.com>
    > Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
    > ---
    > drivers/irqchip/irq-stm32-exti.c | 14 ++++++++++++++
    > 1 file changed, 14 insertions(+)
    >
    > diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
    > index c8003f4f0457..3f6d524a87fe 100644
    > --- a/drivers/irqchip/irq-stm32-exti.c
    > +++ b/drivers/irqchip/irq-stm32-exti.c
    > @@ -550,6 +550,16 @@ static void stm32_exti_h_unmask(struct irq_data *d)
    > irq_chip_unmask_parent(d);
    > }
    >
    > +static int stm32_exti_h_request_resources(struct irq_data *data)
    > +{
    > + data = data->parent_data;
    > +
    > + if (data->chip->irq_request_resources)
    > + return data->chip->irq_request_resources(data);
    > +
    > + return 0;
    > +}

    Why do you need to reinvent the whole thing? Why isn't it just:

    static int stm32_exti_h_request_resources(struct irq_data *data)
    {
    irq_chip_request_resources_parent(data);
    return 0;
    }

    And this really deserves a comment. I also wonder whether we should
    change this behaviour to always return 0.

    M.

    --
    Without deviation from the norm, progress is not possible.

    \
     
     \ /
      Last update: 2022-05-10 20:45    [W:2.388 / U:0.748 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site