summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-07-03 11:27:53 +0200
committerJonathan Cameron <jic23@kernel.org>2012-07-08 10:39:59 +0100
commitc732a24c5a9392cf3738f5957e0d97d37c09e6e1 (patch)
tree8a8810166b2839e3a6f4e87f877266f7c5f75639
parentd297b9bdad044a732223b44c19e8223d93fd3aa0 (diff)
downloadlinux-3.10-c732a24c5a9392cf3738f5957e0d97d37c09e6e1.tar.gz
linux-3.10-c732a24c5a9392cf3738f5957e0d97d37c09e6e1.tar.bz2
linux-3.10-c732a24c5a9392cf3738f5957e0d97d37c09e6e1.zip
staging:iio:adt7410: use local platformdata if none is specified
The adt7410 expects information about an irq in platform_data. The driver can work without an irq, so make platform_data optional by specifying a dummy platform_data if the device has none. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/staging/iio/adc/adt7410.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/iio/adc/adt7410.c b/drivers/staging/iio/adc/adt7410.c
index 1a4197013e9..42fe2c8c49f 100644
--- a/drivers/staging/iio/adc/adt7410.c
+++ b/drivers/staging/iio/adc/adt7410.c
@@ -720,6 +720,7 @@ static int __devinit adt7410_probe(struct i2c_client *client,
struct iio_dev *indio_dev;
int ret = 0;
unsigned long *adt7410_platform_data = client->dev.platform_data;
+ unsigned long local_pdata[] = {0, 0};
indio_dev = iio_device_alloc(sizeof(*chip));
if (indio_dev == NULL) {
@@ -737,6 +738,9 @@ static int __devinit adt7410_probe(struct i2c_client *client,
indio_dev->info = &adt7410_info;
indio_dev->modes = INDIO_DIRECT_MODE;
+ if (!adt7410_platform_data)
+ adt7410_platform_data = local_pdata;
+
/* CT critcal temperature event. line 0 */
if (client->irq) {
ret = request_threaded_irq(client->irq,