linux_dsm_epyc7002/drivers/iio/adc
Alexandre Belloni 467a44b037 iio: adc: at91_adc: Repair broken platform_data support
Trying to use the at91_adc driver while not using device tree is ending up in a
kernel crash:

Unable to handle kernel NULL pointer dereference at virtual address 00000004
[...]
[<c01f3510>] (at91_adc_probe) from [<c0183828>] (platform_drv_probe+0x18/0x48)
[<c0183828>] (platform_drv_probe) from [<c01824a4>] (driver_probe_device+0x100/0x218)
[<c01824a4>] (driver_probe_device) from [<c0182648>] (__driver_attach+0x8c/0x90)
[<c0182648>] (__driver_attach) from [<c0180de4>] (bus_for_each_dev+0x58/0x88)
[<c0180de4>] (bus_for_each_dev) from [<c0181c7c>] (bus_add_driver+0xd4/0x1d4)
[<c0181c7c>] (bus_add_driver) from [<c0182c40>] (driver_register+0x78/0xf4)
[<c0182c40>] (driver_register) from [<c0008998>] (do_one_initcall+0xe8/0x14c)
[<c0008998>] (do_one_initcall) from [<c02f0b50>] (kernel_init_freeable+0xec/0x1b4)
[<c02f0b50>] (kernel_init_freeable) from [<c022acdc>] (kernel_init+0x8/0xe4)
[<c022acdc>] (kernel_init) from [<c0009670>] (ret_from_fork+0x14/0x24)

This is because the at91_adc_caps structure is mandatory but is not filled when
using platform_data. Correct that by using an id_table. It ensues that the
driver will not match "at91_adc" anymore but it was crashing anyway.

Fixes: c46016665f (iio: at91: ADC start-up time calculation changed since at91sam9x5)
Cc: stable@vger.kernel.org # v3.13+

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-03-06 19:08:12 +00:00
..
ad7266.c iio:ad7266: Mark transfer buffer as __be16 2013-12-03 20:22:27 +00:00
ad7298.c iio:ad7298: Use iio_push_to_buffers_with_timestamp() 2013-09-21 19:23:52 +01:00
ad7476.c iio:ad7476: Report scale as fractional value 2013-10-01 16:19:12 +01:00
ad7791.c iio:ad7791: Report scale as fractional value 2013-10-01 16:19:12 +01:00
ad7793.c iio: adc: ad7793: Use devm_* APIs 2013-08-03 18:40:39 +01:00
ad7887.c iio:adc:ad7887 Fix channel reported endianness from cpu to big endian 2013-12-17 20:37:14 +00:00
ad7923.c iio:ad7923: Use iio_push_to_buffers_with_timestamp() 2013-09-21 19:23:53 +01:00
ad_sigma_delta.c tree-wide: use reinit_completion instead of INIT_COMPLETION 2013-11-15 09:32:21 +09:00
at91_adc.c iio: adc: at91_adc: Repair broken platform_data support 2014-03-06 19:08:12 +00:00
exynos_adc.c iio: exynos_adc: Use devm_iio_device_alloc 2013-08-03 18:40:42 +01:00
Kconfig iio:ti_am335x_adc ensure that IIO_KFIFO_BUF is not selected witout IIO_BUFFER 2013-09-28 11:36:29 +01:00
lp8788_adc.c iio: adc: lp8788_adc: Use devm_* APIs 2013-08-03 18:40:40 +01:00
Makefile iio: adc: Add driver for Microchip MCP3422/3/4 high resolution ADC 2013-09-07 22:17:44 +01:00
max1363.c iio: max1363: Use devm_regulator_get_optional for optional regulator 2014-02-08 11:46:00 +00:00
mcp320x.c iio: adc: mcp320x: Use devm_* APIs 2013-08-03 18:40:41 +01:00
mcp3422.c Merge v3.13-rc2 into staging-next 2013-12-02 16:39:07 -08:00
nau7802.c tree-wide: use reinit_completion instead of INIT_COMPLETION 2013-11-15 09:32:21 +09:00
ti_am335x_adc.c Immutable branch for IIO and Input 2014-01-21 08:26:55 +00:00
ti-adc081c.c iio: adc: ti-adc081c: Include linux/of.h header 2013-10-18 20:05:56 +01:00
twl6030-gpadc.c treewide: Fix typos in printk 2013-12-19 15:10:49 +01:00
viperboard_adc.c iio: adc: viperboard: Use devm_iio_device_register 2013-11-24 21:07:15 +00:00