From 4050f493996b3fbebe4ee0db4a16083d67d6e85b Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Fri, 2 Sep 2011 17:25:24 +0100 Subject: [PATCH] staging:iio:adc:ad7152 set correct number of channels for ad7153. Has been broken for some time. Signed-off-by: Jonathan Cameron Acked-by: Michael Hennerich Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/adc/ad7152.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7152.c b/drivers/staging/iio/adc/ad7152.c index ed8fdc6b7e30..1ec012dfacc1 100644 --- a/drivers/staging/iio/adc/ad7152.c +++ b/drivers/staging/iio/adc/ad7152.c @@ -402,6 +402,10 @@ static int __devinit ad7152_probe(struct i2c_client *client, indio_dev->dev.parent = &client->dev; indio_dev->info = &ad7152_info; indio_dev->channels = ad7152_channels; + if (id->driver_data == 0) + indio_dev->num_channels = ARRAY_SIZE(ad7152_channels); + else + indio_dev->num_channels = 1; indio_dev->num_channels = ARRAY_SIZE(ad7152_channels); indio_dev->modes = INDIO_DIRECT_MODE; @@ -430,7 +434,7 @@ static int __devexit ad7152_remove(struct i2c_client *client) static const struct i2c_device_id ad7152_id[] = { { "ad7152", 0 }, - { "ad7153", 0 }, + { "ad7153", 1 }, {} }; -- 2.20.1