From 845bd12ac78f92ba8905f45de7e17a4a8b3cef40 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Wed, 18 May 2011 14:41:44 +0100 Subject: staging:iio: use the new central name attribute creation code Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/imu/adis16400_core.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'drivers/staging/iio/imu') diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c index ddcae4372620..6419b756421c 100644 --- a/drivers/staging/iio/imu/adis16400_core.c +++ b/drivers/staging/iio/imu/adis16400_core.c @@ -427,16 +427,6 @@ static IIO_DEVICE_ATTR(reset, S_IWUSR, NULL, adis16400_write_reset, 0); static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("409 546 819 1638"); -static ssize_t adis16400_show_name(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct adis16400_state *st - = iio_dev_get_devdata(dev_get_drvdata(dev)); - return sprintf(buf, "%s\n", spi_get_device_id(st->us)->name); -} -static IIO_DEVICE_ATTR(name, S_IRUGO, adis16400_show_name, NULL, 0); - enum adis16400_chan { in_supply, gyro_x, @@ -704,7 +694,6 @@ static struct attribute *adis16400_attributes[] = { &iio_dev_attr_sampling_frequency.dev_attr.attr, &iio_const_attr_sampling_frequency_available.dev_attr.attr, &iio_dev_attr_reset.dev_attr.attr, - &iio_dev_attr_name.dev_attr.attr, NULL }; @@ -814,6 +803,7 @@ static int __devinit adis16400_probe(struct spi_device *spi) } st->variant = &adis16400_chips[spi_get_device_id(spi)->driver_data]; st->indio_dev->dev.parent = &spi->dev; + st->indio_dev->name = spi_get_device_id(spi)->name; st->indio_dev->attrs = &adis16400_attribute_group; st->indio_dev->channels = st->variant->channels; st->indio_dev->num_channels = st->variant->num_channels; -- cgit v1.2.3