summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-10-05 15:28:03 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-05 13:47:47 -0700
commitbf52f0591f85eaa339a4707a4636bb62cba7ffff (patch)
tree056a3933b72af7ed8817a7bc2785a8772b63c0f7 /drivers
parent10e4a52b6e471cea2e87e71f8708a8c8c6b75266 (diff)
staging:iio:resolver:ad2s1210 ensure iio_dev->name is set
This is needed to ensure the required name attribute is created. Using an id table is the route most consistent with other drivers. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/iio/resolver/ad2s1210.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
index 5c9c409ec7c..9a88563a7fe 100644
--- a/drivers/staging/iio/resolver/ad2s1210.c
+++ b/drivers/staging/iio/resolver/ad2s1210.c
@@ -760,6 +760,7 @@ static int __devinit ad2s1210_probe(struct spi_device *spi)
indio_dev->dev.parent = &spi->dev;
indio_dev->info = &ad2s1210_info;
indio_dev->modes = INDIO_DIRECT_MODE;
+ indio_dev->name = spi_get_device_id(spi)->name;
ret = iio_device_register(indio_dev);
if (ret)
@@ -791,6 +792,11 @@ static int __devexit ad2s1210_remove(struct spi_device *spi)
return 0;
}
+static const struct spi_device_id ad2s1210_id[] = {
+ { "ad2s1210" },
+ {}
+};
+
static struct spi_driver ad2s1210_driver = {
.driver = {
.name = DRV_NAME,
@@ -798,6 +804,7 @@ static struct spi_driver ad2s1210_driver = {
},
.probe = ad2s1210_probe,
.remove = __devexit_p(ad2s1210_remove),
+ .id_table = ad2s1210_id,
};
static __init int ad2s1210_spi_init(void)