Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1211552

Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50

From Stefan Agner <stefan@agner.ch>
Newsgroups linux.kernel
Subject Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50
Date 2015-08-23 04:00 +0200
Message-ID <q0sJI-3jr-3@gated-at.bofh.it> (permalink)
References <pZUI2-548-7@gated-at.bofh.it> <pZUI4-548-51@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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


Otherwise, Acked-by: Stefan Agner <stefan@agner.ch>

--
Stefan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50 Sanchayan Maity <maitysanchayan@gmail.com> - 2015-08-21 15:40 +0200
  Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen  support for Colibri VF50 Stefan Agner <stefan@agner.ch> - 2015-08-23 04:00 +0200
    Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen  support for Colibri VF50 maitysanchayan@gmail.com - 2015-08-23 17:40 +0200
  Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen  support for Colibri VF50 Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-08-24 03:30 +0200
    Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen  support for Colibri VF50 maitysanchayan@gmail.com - 2015-08-24 06:40 +0200

csiph-web