lkml.org 
[lkml]   [2011]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3] pch_gpio: Support interrupt function
Date
On Thursday 30 June 2011 04:07:16 Tomoya MORINAGA wrote:
> Hi Grant,
>
> If you don't have any concern, would you accept this patch ?
>
> Thanks,
>
> (2011/06/21 13:44), Tomoya MORINAGA wrote:
> > Support interrupt function using irq_chip_generic
> >
> > Signed-off-by: Tomoya MORINAGA<tomoya-linux@dsn.okisemi.com>
> > ---
> > @@ -202,8 +345,36 @@ static int __devinit pch_gpio_probe(struct pci_dev
> > *pdev,
> >
> > goto err_gpiochip_add;
> >
> > }
> >
> > + irq_base = irq_alloc_descs(-1, PCH_IRQ_BASE, GPIO_NUM_PINS,
> > GFP_KERNEL); + if (irq_base< 0) {
> > + dev_err(&pdev->dev, "PCH gpio: Failed to get IRQ base num\n");
> > + goto err_irq_alloc_descs;
> > + }
> > + chip->irq_base = irq_base;
> > +
> > + ret = request_irq(pdev->irq, pch_gpio_handler,
> > + IRQF_SHARED, KBUILD_MODNAME, chip);
> > + if (ret != 0) {
> > + dev_err(&pdev->dev,
> > + "%s request_irq failed\n", __func__);
> > + goto err_request_irq;
> > + }
> > +
> > + pch_gpio_alloc_generic_chip(chip, irq_base, GPIO_NUM_PINS);
> > +
> > + /* Initialize interrupt ien register */
> > + iowrite32(0,&chip->reg->ien);
> > +
> >
> > return 0;
> >
> > +err_request_irq:
> > + irq_free_descs(irq_base, GPIO_NUM_PINS);
> > +
> > +err_irq_alloc_descs:
> > + ret = gpiochip_remove(&chip->gpio);
> > + if (ret)
> > + dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__);
> > +
> >
> > err_gpiochip_add:
> > pci_iounmap(pdev, chip->base);
> >
> > @@ -224,6 +395,8 @@ static void __devexit pch_gpio_remove(struct pci_dev
> > *pdev)
> >
> > int err;
> > struct pch_gpio *chip = pci_get_drvdata(pdev);
> >
> > + irq_free_descs(chip->irq_base, GPIO_NUM_PINS);
> > +

Is a free_irq missing here?

> >
> > err = gpiochip_remove(&chip->gpio);
> > if (err)
> >
> > dev_err(&pdev->dev, "Failed gpiochip_remove\n");

Regards,
Alexander


\
 
 \ /
  Last update: 2011-06-30 09:55    [W:0.139 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site