diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-05-18 14:41:44 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-19 16:14:54 -0700 |
commit | 845bd12ac78f92ba8905f45de7e17a4a8b3cef40 (patch) | |
tree | 5a021f5173861619b66a6baf68772a14ace95f92 /drivers/staging/iio/dds | |
parent | 1b732888d83f71a31a4bd26290ca8a00df1bf928 (diff) |
staging:iio: use the new central name attribute creation code
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/dds')
-rw-r--r-- | drivers/staging/iio/dds/ad9832.c | 13 | ||||
-rw-r--r-- | drivers/staging/iio/dds/ad9834.c | 13 |
2 files changed, 2 insertions, 24 deletions
diff --git a/drivers/staging/iio/dds/ad9832.c b/drivers/staging/iio/dds/ad9832.c index 9c6114f4976b..4b5721cbac66 100644 --- a/drivers/staging/iio/dds/ad9832.c +++ b/drivers/staging/iio/dds/ad9832.c @@ -153,17 +153,6 @@ error_ret: return ret ? ret : len; } -static ssize_t ad9832_show_name(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct iio_dev *dev_info = dev_get_drvdata(dev); - struct ad9832_state *st = iio_dev_get_devdata(dev_info); - - return sprintf(buf, "%s\n", spi_get_device_id(st->spi)->name); -} -static IIO_DEVICE_ATTR(name, S_IRUGO, ad9832_show_name, NULL, 0); - /** * see dds.h for further information */ @@ -199,7 +188,6 @@ static struct attribute *ad9832_attributes[] = { &iio_dev_attr_dds0_freqsymbol.dev_attr.attr, &iio_dev_attr_dds0_phasesymbol.dev_attr.attr, &iio_dev_attr_dds0_out_enable.dev_attr.attr, - &iio_dev_attr_name.dev_attr.attr, NULL, }; @@ -243,6 +231,7 @@ static int __devinit ad9832_probe(struct spi_device *spi) } st->indio_dev->dev.parent = &spi->dev; + st->indio_dev->name = spi_get_device_id(spi)->name; st->indio_dev->attrs = &ad9832_attribute_group; st->indio_dev->dev_data = (void *) st; st->indio_dev->driver_module = THIS_MODULE; diff --git a/drivers/staging/iio/dds/ad9834.c b/drivers/staging/iio/dds/ad9834.c index 6dbc45890cd2..e5303e6139ae 100644 --- a/drivers/staging/iio/dds/ad9834.c +++ b/drivers/staging/iio/dds/ad9834.c @@ -198,17 +198,6 @@ static ssize_t ad9834_store_wavetype(struct device *dev, return ret ? ret : len; } -static ssize_t ad9834_show_name(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct iio_dev *dev_info = dev_get_drvdata(dev); - struct ad9834_state *st = iio_dev_get_devdata(dev_info); - - return sprintf(buf, "%s\n", spi_get_device_id(st->spi)->name); -} -static IIO_DEVICE_ATTR(name, S_IRUGO, ad9834_show_name, NULL, 0); - static ssize_t ad9834_show_out0_wavetype_available(struct device *dev, struct device_attribute *attr, char *buf) @@ -288,7 +277,6 @@ static struct attribute *ad9834_attributes[] = { &iio_dev_attr_dds0_out1_wavetype.dev_attr.attr, &iio_dev_attr_dds0_out0_wavetype_available.dev_attr.attr, &iio_dev_attr_dds0_out1_wavetype_available.dev_attr.attr, - &iio_dev_attr_name.dev_attr.attr, NULL, }; @@ -355,6 +343,7 @@ static int __devinit ad9834_probe(struct spi_device *spi) } st->indio_dev->dev.parent = &spi->dev; + st->indio_dev->name = spi_get_device_id(spi)->name; st->indio_dev->attrs = &ad9834_attribute_group; st->indio_dev->dev_data = (void *) st; st->indio_dev->driver_module = THIS_MODULE; |