RE: [EXT] Re: [PATCH] gpio: mxc: release the parent IRQ in runtime suspend

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

 




> -----Original Message-----
> From: Andy Shevchenko <andy@xxxxxxxxxx>
> Sent: Tuesday, August 8, 2023 12:39 PM
> To: Shenwei Wang <shenwei.wang@xxxxxxx>
> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>; Bartosz Golaszewski
> > +static void mxc_update_irq_chained_handler(struct mxc_gpio_port
> > +*port, bool enable) {
> > +     if (!port)
> > +             return;
> 
> When can this be true?
> 

If the function is called at right place and right time, it won't be true. Just in case. 😊

> > +     if (enable) {
> > +             irq_set_chained_handler_and_data(port->irq,
> > +                                              port->mx_irq_handler, port);
> > +             if (port->irq_high > 0)
> > +                     /* setup handler for GPIO 16 to 31 */
> > +                     irq_set_chained_handler_and_data(port->irq_high,
> > +                                                      port->mx_irq_handler,
> > +                                                      port);
> > +     } else {
> > +             irq_set_chained_handler_and_data(port->irq, NULL, NULL);
> > +             if (port->irq_high > 0)
> > +                     irq_set_chained_handler_and_data(port->irq_high, NULL, NULL);
> > +     }
> > +}
> 
> Why not
> 
>         if (enable)
>                 irq_set_chained_handler_and_data(port->irq,
>                                                  port->mx_irq_handler, port);
>         else
>                 irq_set_chained_handler_and_data(port->irq, NULL, NULL);
> 
>         /* setup handler for GPIO 16 to 31 */
>         if (port->irq_high > 0) {
>                 if (enable)
>                         irq_set_chained_handler_and_data(port->irq_high,
>                                                          port->mx_irq_handler, port);
>                 else
>                         irq_set_chained_handler_and_data(port->irq_high, NULL, NULL);
>         }
> 
> Wouldn't it be better to read and understand?
> 

Looks better to read.

Thanks,
Shenwei

> --
> 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