From: Alexander Stein <alexander.stein@systec-electronic.com>
To: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
linux-kernel@vger.kernel.org, qi.wang@intel.com,
yong.y.wang@intel.com, joel.clark@intel.com,
kok.howg.ewe@intel.com, toshiharu-linux@dsn.okisemi.com
Subject: Re: [PATCH v3] pch_gpio: Support interrupt function
Date: Thu, 30 Jun 2011 09:53:15 +0200 [thread overview]
Message-ID: <201106300953.16654.alexander.stein@systec-electronic.com> (raw)
In-Reply-To: <4E0BDA54.2080007@dsn.okisemi.com>
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
prev parent reply other threads:[~2011-06-30 7:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-21 4:44 Tomoya MORINAGA
2011-06-21 9:10 ` Alexander Stein
2011-06-22 0:10 ` Tomoya MORINAGA
2011-06-22 6:28 ` Alexander Stein
2011-06-22 8:14 ` Tomoya MORINAGA
2011-06-22 9:15 ` Alexander Stein
2011-06-27 10:03 ` Alexander Stein
2011-06-30 2:07 ` Tomoya MORINAGA
2011-06-30 7:53 ` Alexander Stein [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201106300953.16654.alexander.stein@systec-electronic.com \
--to=alexander.stein@systec-electronic.com \
--cc=grant.likely@secretlab.ca \
--cc=joel.clark@intel.com \
--cc=kok.howg.ewe@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qi.wang@intel.com \
--cc=tomoya-linux@dsn.okisemi.com \
--cc=toshiharu-linux@dsn.okisemi.com \
--cc=yong.y.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®