]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
iio: adc: at91: unbreak channel adc channel 3
authorAnders Darander <anders@chargestorm.se>
Mon, 8 Aug 2016 12:42:16 +0000 (14:42 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 20 Oct 2016 13:04:58 +0000 (08:04 -0500)
commita15d59ffe05865b4c28c08c01abf5632b29d5d74
tree35b598f8c18ae7b1e014cc27f6d73a733d14facb
parenteecaf3b8a0c8c72354e03d8a256871260524a03f
iio: adc: at91: unbreak channel adc channel 3

BugLink: http://bugs.launchpad.net/bugs/1627730
commit c2ab447454d498e709d9011c0f2d2945ee321f9b upstream.

The driver always assumes that an input device has been created when
reading channel 3. This causes a kernel panic when dereferencing
st->ts_input.

The change was introduced in
commit 84882b060301 ("iio: adc: at91_adc: Add support for touchscreens
without TSMR"). Earlier versions only entered that part of the if-else
statement if only the following flags are set:

AT91_ADC_IER_XRDY | AT91_ADC_IER_YRDY | AT91_ADC_IER_PRDY

Signed-off-by: Anders Darander <anders@chargestorm.se>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/iio/adc/at91_adc.c