Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adxl372: Use IIO_STATIC_CONST_DEVICE_ATTR()

Slightly simplify by dropping open-coded constant data iio_dev_attr
functions and using the IIO_STATIC_CONST_DEVICE_ATTR() instead.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/3632af8849ef101c54ec1f739596f22c773b067c.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Matti Vaittinen and committed by
Jonathan Cameron
f7e68045 f0ab171b

+3 -16
+3 -16
drivers/iio/accel/adxl372.c
··· 998 998 return sprintf(buf, "%d\n", st->watermark); 999 999 } 1000 1000 1001 - static ssize_t hwfifo_watermark_min_show(struct device *dev, 1002 - struct device_attribute *attr, 1003 - char *buf) 1004 - { 1005 - return sysfs_emit(buf, "%s\n", "1"); 1006 - } 1007 - 1008 - static ssize_t hwfifo_watermark_max_show(struct device *dev, 1009 - struct device_attribute *attr, 1010 - char *buf) 1011 - { 1012 - return sysfs_emit(buf, "%s\n", __stringify(ADXL372_FIFO_SIZE)); 1013 - } 1014 - 1015 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0); 1016 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0); 1001 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "1"); 1002 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max, 1003 + __stringify(ADXL372_FIFO_SIZE)); 1017 1004 static IIO_DEVICE_ATTR(hwfifo_watermark, 0444, 1018 1005 adxl372_get_fifo_watermark, NULL, 0); 1019 1006 static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,