From: Markus Pargmann <mpa@pengutronix.de>
To: Lee Jones <lee.jones@linaro.org>
Cc: "Fabio Estevam" <festevam@gmail.com>,
"Shawn Guo" <shawn.guo@linaro.org>,
"Samuel Ortiz" <sameo@linux.intel.com>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Peter Meerwald" <pmeerw@pmeerw.net>,
"Hartmut Knaack" <knaack.h@gmx.de>,
"Denis Carikli" <denis@eukrea.com>,
"Eric Bénard" <eric@eukrea.com>,
"Sascha Hauer" <kernel@pengutronix.de>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
"Lars-Peter Clausen" <lars@metafoo.de>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Pawel Moll" <pawel.moll@arm.com>,
"Mark Rutland" <mark.rutland@arm.com>,
"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
"Kumar Gala" <galak@codeaurora.org>
Subject: Re: [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>
[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]
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 |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
WARNING: multiple messages have this Message-ID (diff)
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: 50+ 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 ` Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 1/6] mfd: fsl imx25 Touchscreen ADC driver Markus Pargmann
2015-01-24 14:01 ` Markus Pargmann
[not found] ` <1422108103-15052-2-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-02-16 13:38 ` Lee Jones
2015-02-16 13:38 ` Lee Jones
2015-02-16 13:38 ` Lee Jones
2015-02-17 18:54 ` Fabio Estevam
2015-02-17 18:54 ` Fabio Estevam
2015-02-17 18:54 ` Fabio Estevam
2015-02-18 8:01 ` Lee Jones
2015-02-18 8:01 ` Lee Jones
2015-02-18 8:01 ` Lee Jones
2015-02-18 11:57 ` Fabio Estevam
2015-02-18 11:57 ` Fabio Estevam
2015-02-18 11:57 ` Fabio Estevam
2015-02-18 12:08 ` Lee Jones
2015-02-18 12:08 ` Lee Jones
2015-02-18 12:08 ` Lee Jones
2015-02-26 15:32 ` Markus Pargmann [this message]
2015-02-26 15:32 ` Markus Pargmann
2015-02-17 19:14 ` Uwe Kleine-König
2015-02-17 19:14 ` Uwe Kleine-König
2015-02-17 19:14 ` Uwe Kleine-König
2015-03-02 19:12 ` Markus Pargmann
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 ` Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 3/6] iio: adc: fsl,imx25-gcq driver Markus Pargmann
2015-01-24 14:01 ` Markus Pargmann
2015-01-27 20:30 ` Jonathan Cameron
2015-01-27 20:30 ` Jonathan Cameron
[not found] ` <54C7F580.1030901-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-01-29 10:11 ` Markus Pargmann
2015-01-29 10:11 ` Markus Pargmann
2015-01-29 10:11 ` Markus Pargmann
[not found] ` <20150129101104.GE27422-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-02-08 11:56 ` Jonathan Cameron
2015-02-08 11:56 ` Jonathan Cameron
2015-02-08 11:56 ` Jonathan Cameron
[not found] ` <1422108103-15052-4-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-01-29 14:51 ` Fabio Estevam
2015-01-29 14:51 ` Fabio Estevam
2015-01-29 14:51 ` Fabio Estevam
2015-01-30 7:27 ` Markus Pargmann
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 ` Markus Pargmann
[not found] ` <1422108103-15052-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-01-24 14:01 ` [PATCH v5 5/6] ARM: dts: imx25: Add TSC and ADC support Markus Pargmann
2015-01-24 14:01 ` Markus Pargmann
2015-01-24 14:01 ` Markus Pargmann
2015-01-24 14:01 ` [PATCH v5 6/6] ARM: imx_v4_v5_defconfig: Add I.MX25 Touchscreen controller " Markus Pargmann
2015-01-24 14:01 ` 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=denis@eukrea.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=eric@eukrea.com \
--cc=festevam@gmail.com \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@kernel.org \
--cc=sameo@linux.intel.com \
--cc=shawn.guo@linaro.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 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.