From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/6] mfd: fsl imx25 Touchscreen ADC driver
Date: Thu, 26 Feb 2015 16:32:51 +0100 [thread overview]
Message-ID: <20150226153251.GD10070@pengutronix.de> (raw)
In-Reply-To: <20150218120844.GC22296@x1>
On Wed, Feb 18, 2015 at 12:08:44PM +0000, Lee Jones wrote:
> On Wed, 18 Feb 2015, Fabio Estevam wrote:
>
> > On Wed, Feb 18, 2015 at 6:01 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > On Tue, 17 Feb 2015, Fabio Estevam wrote:
> > >
> > >> On Mon, Feb 16, 2015 at 11:38 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > >>
> > >> >> +static int mx25_tsadc_setup_irq(struct platform_device *pdev,
> > >> >> + struct mx25_tsadc *tsadc)
> > >> >> +{
> > >> >> + struct device *dev = &pdev->dev;
> > >> >> + struct device_node *np = dev->of_node;
> > >> >> + int irq;
> > >> >> +
> > >> >> + irq = platform_get_irq(pdev, 0);
> > >> >> + if (irq < 0) {
> > >> >
> > >> > What if 0 is returned?
> > >>
> > >> Then imx25.dtsi would be passing irq=0 for the ADC, which would be
> > >> totally wrong.
> > >
> > > Exactly, so it should be <=.
> >
> > imx25.dtsi passes interrupts = <46>; for the touch screen controller,
> > so the irq number will never be zero.
>
> It doesn't matter what happens to be passed at the moment. The
> correct thing to do is enforce correct/full error checking. Yes <0 is
> an error, but so is =0, so encompass it in the checks.
I now changed all irq < 0 checks to irq <= 0 under the assumption that
irq 0 is always an error.
Thanks,
Markus
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150226/1944dc3f/attachment.sig>
next prev parent reply other threads:[~2015-02-26 15:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-24 14:01 [PATCH v5 0/6] imx25 adc and touchscreen driver Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 1/6] mfd: fsl imx25 Touchscreen ADC driver Markus Pargmann
2015-02-16 13:38 ` Lee Jones
2015-02-17 18:54 ` Fabio Estevam
2015-02-18 8:01 ` Lee Jones
2015-02-18 11:57 ` Fabio Estevam
2015-02-18 12:08 ` Lee Jones
2015-02-26 15:32 ` Markus Pargmann [this message]
2015-02-17 19:14 ` Uwe Kleine-König
2015-03-02 19:12 ` Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 2/6] ARM: dt: Binding documentation for imx25 ADC/TSC Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 3/6] iio: adc: fsl,imx25-gcq driver Markus Pargmann
2015-01-27 20:30 ` Jonathan Cameron
2015-01-29 10:11 ` Markus Pargmann
2015-02-08 11:56 ` Jonathan Cameron
2015-01-29 14:51 ` Fabio Estevam
2015-01-30 7:27 ` Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 4/6] input: touchscreen: imx25 tcq driver Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 5/6] ARM: dts: imx25: Add TSC and ADC support Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 6/6] ARM: imx_v4_v5_defconfig: Add I.MX25 Touchscreen controller " Markus Pargmann
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=20150226153251.GD10070@pengutronix.de \
--to=mpa@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).