From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Roland Stigge <stigge@antcom.de>
Cc: axel.lin@gmail.com, riyer@nvidia.com,
michael.hennerich@analog.com, grant.likely@secretlab.ca,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kevin.wells@nxp.com,
srinivas.bakki@nxp.com, devicetree-discuss@lists.ozlabs.org,
rob.herring@calxeda.com, aletes.xgr@gmail.com
Subject: Re: [PATCH v9] input: keyboard: Add keys driver for the LPC32xx SoC
Date: Wed, 11 Jul 2012 00:52:35 -0700 [thread overview]
Message-ID: <20120711075235.GA27353@core.coreip.homeip.net> (raw)
In-Reply-To: <4FFD2FF0.8030000@antcom.de>
On Wed, Jul 11, 2012 at 09:49:04AM +0200, Roland Stigge wrote:
> On 07/10/2012 10:55 PM, Dmitry Torokhov wrote:
> > Hi Roland,
> >
> > On Tue, Jul 10, 2012 at 09:35:10PM +0200, Roland Stigge wrote:
> >> This patch adds a driver for the key scan interface of the LPC32xx SoC
> >>
> >
> > Could of more things that I had in my patch but forgot to specifically
> > call out:
> >
> >> +
> >> + /* Configure the key scanner */
> >> + clk_prepare_enable(kscandat->clk);
> >
> > This may fail so we should handle errors.
> >
> >> + writel(kscandat->deb_clks, LPC32XX_KS_DEB(kscandat->kscan_base));
> >> + writel(kscandat->scan_delay, LPC32XX_KS_SCAN_CTL(kscandat->kscan_base));
> >> + writel(LPC32XX_KSCAN_FTST_USE32K_CLK,
> >> + LPC32XX_KS_FAST_TST(kscandat->kscan_base));
> >> + writel(kscandat->matrix_sz,
> >> + LPC32XX_KS_MATRIX_DIM(kscandat->kscan_base));
> >> + writel(1, LPC32XX_KS_IRQ(kscandat->kscan_base));
> >> + clk_disable_unprepare(kscandat->clk);
> >> +
> >> + error = request_irq(irq, lpc32xx_kscan_irq, 0, pdev->name, kscandat);
> >
> > ...
> >
> >> +
> >> + free_irq(platform_get_irq(pdev, 0), pdev);
> >
> > You are requesting IRQ with kscandat as an argument but freeing it with
> > 'pdev' which will fail.
> >
> >> +
> >> + if (kscandat->input->users) {
> >> + /* Enable clock and clear IRQ */
> >> + clk_prepare_enable(kscandat->clk);
> >
> > Need to handle errors here as well.
> >
> > Since I am partial to my rearrangement (basically I started preferring
> > err_<action> style of error labels as they more explanatory than out2 or
> > fail3 style of labels), could you try this version of my patch (on top
> > of your v9 one). Third time is a charm maybe? :)
>
> Yes, works fine!
>
> Thanks!
>
> Acked-by: Roland Stigge <stigge@antcom.de>
Excellent, I'll fold it up into your original v9 patch and queue for
3.6.
Thank you for your patience.
--
Dmitry
WARNING: multiple messages have this Message-ID (diff)
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9] input: keyboard: Add keys driver for the LPC32xx SoC
Date: Wed, 11 Jul 2012 00:52:35 -0700 [thread overview]
Message-ID: <20120711075235.GA27353@core.coreip.homeip.net> (raw)
In-Reply-To: <4FFD2FF0.8030000@antcom.de>
On Wed, Jul 11, 2012 at 09:49:04AM +0200, Roland Stigge wrote:
> On 07/10/2012 10:55 PM, Dmitry Torokhov wrote:
> > Hi Roland,
> >
> > On Tue, Jul 10, 2012 at 09:35:10PM +0200, Roland Stigge wrote:
> >> This patch adds a driver for the key scan interface of the LPC32xx SoC
> >>
> >
> > Could of more things that I had in my patch but forgot to specifically
> > call out:
> >
> >> +
> >> + /* Configure the key scanner */
> >> + clk_prepare_enable(kscandat->clk);
> >
> > This may fail so we should handle errors.
> >
> >> + writel(kscandat->deb_clks, LPC32XX_KS_DEB(kscandat->kscan_base));
> >> + writel(kscandat->scan_delay, LPC32XX_KS_SCAN_CTL(kscandat->kscan_base));
> >> + writel(LPC32XX_KSCAN_FTST_USE32K_CLK,
> >> + LPC32XX_KS_FAST_TST(kscandat->kscan_base));
> >> + writel(kscandat->matrix_sz,
> >> + LPC32XX_KS_MATRIX_DIM(kscandat->kscan_base));
> >> + writel(1, LPC32XX_KS_IRQ(kscandat->kscan_base));
> >> + clk_disable_unprepare(kscandat->clk);
> >> +
> >> + error = request_irq(irq, lpc32xx_kscan_irq, 0, pdev->name, kscandat);
> >
> > ...
> >
> >> +
> >> + free_irq(platform_get_irq(pdev, 0), pdev);
> >
> > You are requesting IRQ with kscandat as an argument but freeing it with
> > 'pdev' which will fail.
> >
> >> +
> >> + if (kscandat->input->users) {
> >> + /* Enable clock and clear IRQ */
> >> + clk_prepare_enable(kscandat->clk);
> >
> > Need to handle errors here as well.
> >
> > Since I am partial to my rearrangement (basically I started preferring
> > err_<action> style of error labels as they more explanatory than out2 or
> > fail3 style of labels), could you try this version of my patch (on top
> > of your v9 one). Third time is a charm maybe? :)
>
> Yes, works fine!
>
> Thanks!
>
> Acked-by: Roland Stigge <stigge@antcom.de>
Excellent, I'll fold it up into your original v9 patch and queue for
3.6.
Thank you for your patience.
--
Dmitry
next prev parent reply other threads:[~2012-07-11 7:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-10 19:35 [PATCH v9] input: keyboard: Add keys driver for the LPC32xx SoC Roland Stigge
2012-07-10 19:35 ` Roland Stigge
2012-07-10 20:55 ` Dmitry Torokhov
2012-07-10 20:55 ` Dmitry Torokhov
[not found] ` <20120710205507.GA377-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2012-07-11 7:49 ` Roland Stigge
2012-07-11 7:49 ` Roland Stigge
2012-07-11 7:49 ` Roland Stigge
2012-07-11 7:52 ` Dmitry Torokhov [this message]
2012-07-11 7:52 ` Dmitry Torokhov
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=20120711075235.GA27353@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=aletes.xgr@gmail.com \
--cc=axel.lin@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=kevin.wells@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=riyer@nvidia.com \
--cc=rob.herring@calxeda.com \
--cc=srinivas.bakki@nxp.com \
--cc=stigge@antcom.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.