From: maitysanchayan@gmail.com
To: Stefan Agner <stefan@agner.ch>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
devicetree@vger.kernel.org, shawnguo@kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50
Date: Sun, 23 Aug 2015 21:01:48 +0530 [thread overview]
Message-ID: <20150823153148.GB3935@Sanchayan-Arch> (raw)
In-Reply-To: <c5cd11ba9b5c3ec228a120e0f1c3c156@agner.ch>
On 15-08-22 18:52:28, Stefan Agner wrote:
> Hi Sanchayan,
>
> On 2015-08-21 06:26, Sanchayan Maity wrote:
> > +static int vf50_ts_probe(struct platform_device *pdev)
> > +{
> > + struct input_dev *input;
> > + struct iio_channel *channels;
> > + struct device *dev = &pdev->dev;
> > + struct vf50_touch_device *touchdev;
> > + int error;
> > +
> > + channels = iio_channel_get_all(dev);
> > + if (IS_ERR(channels))
> > + return PTR_ERR(channels);
>
> Hm, we expect here that four channels are returned, however a faulty
> device tree could contain less. Access to the fourth channel above would
> lead to a bug.
>
> Can you check the amount of channels returned? The returned list is
> explicitly terminated with a null entry, you can rely on that. Something
> similar to hwmon should do the job.
> http://lxr.free-electrons.com/source/drivers/hwmon/iio_hwmon.c#L86
I agree. It did be nice to have this error check. Thanks. I will add
this check so we can bail out if less channels are specified.
- Sanchayan.
>
>
> Otherwise, Acked-by: Stefan Agner <stefan@agner.ch>
>
> --
> Stefan
WARNING: multiple messages have this Message-ID (diff)
From: maitysanchayan@gmail.com (maitysanchayan at gmail.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50
Date: Sun, 23 Aug 2015 21:01:48 +0530 [thread overview]
Message-ID: <20150823153148.GB3935@Sanchayan-Arch> (raw)
In-Reply-To: <c5cd11ba9b5c3ec228a120e0f1c3c156@agner.ch>
On 15-08-22 18:52:28, Stefan Agner wrote:
> Hi Sanchayan,
>
> On 2015-08-21 06:26, Sanchayan Maity wrote:
> > +static int vf50_ts_probe(struct platform_device *pdev)
> > +{
> > + struct input_dev *input;
> > + struct iio_channel *channels;
> > + struct device *dev = &pdev->dev;
> > + struct vf50_touch_device *touchdev;
> > + int error;
> > +
> > + channels = iio_channel_get_all(dev);
> > + if (IS_ERR(channels))
> > + return PTR_ERR(channels);
>
> Hm, we expect here that four channels are returned, however a faulty
> device tree could contain less. Access to the fourth channel above would
> lead to a bug.
>
> Can you check the amount of channels returned? The returned list is
> explicitly terminated with a null entry, you can rely on that. Something
> similar to hwmon should do the job.
> http://lxr.free-electrons.com/source/drivers/hwmon/iio_hwmon.c#L86
I agree. It did be nice to have this error check. Thanks. I will add
this check so we can bail out if less channels are specified.
- Sanchayan.
>
>
> Otherwise, Acked-by: Stefan Agner <stefan@agner.ch>
>
> --
> Stefan
next prev parent reply other threads:[~2015-08-23 15:35 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-21 13:26 [PATCH v4 0/3] Add support for touchscreen on Colibri VF50 Sanchayan Maity
2015-08-21 13:26 ` Sanchayan Maity
2015-08-21 13:26 ` [PATCH v4 1/3] ARM: dts: vf500-colibri: Add device tree node for touchscreen support Sanchayan Maity
2015-08-21 13:26 ` Sanchayan Maity
2015-08-21 13:26 ` Sanchayan Maity
2015-08-23 1:54 ` Stefan Agner
2015-08-23 1:54 ` Stefan Agner
2015-08-23 15:30 ` maitysanchayan
2015-08-23 15:30 ` maitysanchayan at gmail.com
2015-08-21 13:26 ` [PATCH v4 2/3] input: Add DT binding documentation for Colibri VF50 touchscreen Sanchayan Maity
2015-08-21 13:26 ` Sanchayan Maity
2015-08-23 1:36 ` Stefan Agner
2015-08-23 1:36 ` Stefan Agner
2015-08-23 16:15 ` maitysanchayan
2015-08-23 16:15 ` maitysanchayan at gmail.com
2015-08-21 13:26 ` [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50 Sanchayan Maity
2015-08-21 13:26 ` Sanchayan Maity
[not found] ` <915c9122cfba83c6fbbc519c10ae2d101e27bc5b.1440162473.git.maitysanchayan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-08-22 1:30 ` Dmitry Torokhov
2015-08-22 1:30 ` Dmitry Torokhov
2015-08-22 1:30 ` Dmitry Torokhov
2015-08-24 4:32 ` maitysanchayan
2015-08-24 4:32 ` maitysanchayan at gmail.com
2015-08-23 1:52 ` Stefan Agner
2015-08-23 1:52 ` Stefan Agner
2015-08-23 15:31 ` maitysanchayan [this message]
2015-08-23 15:31 ` maitysanchayan at gmail.com
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=20150823153148.GB3935@Sanchayan-Arch \
--to=maitysanchayan@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shawnguo@kernel.org \
--cc=stefan@agner.ch \
/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.