Re: [PATCH] gpio: lynxpoint: Pass irqchip when adding gpiochip

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

 



On Wed, Aug 14, 2019 at 10:46:49AM +0200, Linus Walleij wrote:
> On Mon, Aug 12, 2019 at 12:58 PM Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Mon, Aug 12, 2019 at 10:13:51AM +0200, Linus Walleij wrote:
> 
> > > +             girq->num_parents = 1;
> > > +             girq->parents = devm_kcalloc(&pdev->dev, 1,
> > > +                                          sizeof(*girq->parents),
> > > +                                          GFP_KERNEL);
> > > +             if (!girq->parents)
> > > +                     return -ENOMEM;
> >
> > I understand the point to use kcalloc() for one entry, though I would make
> > intention more explicitly, i.e. use girq->num_parents in it instead of hard
> > coded value.
> 
> That is better, but I have a loose plan to get rid of this
> and just set parents to a fixed width because all the allocation
> is annoying.

I see your intentions, though for current state I think the less hard coded
constants the better. In any case I pushed updated versions to my trees.

> > > +             girq->parents[0] = (unsigned)irq_rc->start;
> > > +             girq->default_type = IRQ_TYPE_NONE;
> >
> > > +             girq->handler = handle_simple_irq;
> >
> > > -             ret = gpiochip_irqchip_add(gc, &lp_irqchip, 0,
> > > -                                        handle_simple_irq, IRQ_TYPE_NONE);
> >
> > Hmm... Now I'm wondering, shall we use handle_bad_irq() here?
> 
> If you are sure that every consumer will call .set_type() you can
> use handle_bad_irq, and that is preferred.

They should do this. Let me prepare the patch for next cycle (v5.5) and I put
it to my tree after merge window. If we see any complains from linux-next
testers, we will act accordingly.

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