diff options
Diffstat (limited to 'drivers/staging/iio/dac/ad5504.c')
-rw-r--r-- | drivers/staging/iio/dac/ad5504.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/staging/iio/dac/ad5504.c b/drivers/staging/iio/dac/ad5504.c index 5534c41..351a9d3 100644 --- a/drivers/staging/iio/dac/ad5504.c +++ b/drivers/staging/iio/dac/ad5504.c @@ -170,17 +170,6 @@ static ssize_t ad5504_show_scale(struct device *dev, } static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5504_show_scale, NULL, 0); -static ssize_t ad5504_show_name(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct iio_dev *indio_dev = dev_get_drvdata(dev); - struct ad5504_state *st = iio_dev_get_devdata(indio_dev); - - return sprintf(buf, "%s\n", spi_get_device_id(st->spi)->name); -} -static IIO_DEVICE_ATTR(name, S_IRUGO, ad5504_show_name, NULL, 0); - #define IIO_DEV_ATTR_OUT_RW_RAW(_num, _show, _store, _addr) \ IIO_DEVICE_ATTR(out##_num##_raw, \ S_IRUGO | S_IWUSR, _show, _store, _addr) @@ -226,7 +215,6 @@ static struct attribute *ad5504_attributes[] = { &iio_dev_attr_out_powerdown_mode.dev_attr.attr, &iio_const_attr_out_powerdown_mode_available.dev_attr.attr, &iio_dev_attr_out_scale.dev_attr.attr, - &iio_dev_attr_name.dev_attr.attr, NULL, }; @@ -240,7 +228,6 @@ static struct attribute *ad5501_attributes[] = { &iio_dev_attr_out_powerdown_mode.dev_attr.attr, &iio_const_attr_out_powerdown_mode_available.dev_attr.attr, &iio_dev_attr_out_scale.dev_attr.attr, - &iio_dev_attr_name.dev_attr.attr, NULL, }; @@ -310,7 +297,7 @@ static int __devinit ad5504_probe(struct spi_device *spi) goto error_disable_reg; } st->indio_dev->dev.parent = &spi->dev; - + st->indio_dev->name = spi_get_device_id(st->spi)->name; st->indio_dev->attrs = spi_get_device_id(st->spi)->driver_data == ID_AD5501 ? &ad5501_attribute_group : &ad5504_attribute_group; |