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: adxl367: 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/c96c55363b8f36017ef7f18fdfe810cd3990e2a4.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Matti Vaittinen and committed by
Jonathan Cameron
f0ab171b 2cc64a23

+3 -16
+3 -16
drivers/iio/accel/adxl367.c
··· 1183 1183 return sysfs_emit(buf, "%d\n", fifo_watermark); 1184 1184 } 1185 1185 1186 - static ssize_t hwfifo_watermark_min_show(struct device *dev, 1187 - struct device_attribute *attr, 1188 - char *buf) 1189 - { 1190 - return sysfs_emit(buf, "%s\n", "1"); 1191 - } 1192 - 1193 - static ssize_t hwfifo_watermark_max_show(struct device *dev, 1194 - struct device_attribute *attr, 1195 - char *buf) 1196 - { 1197 - return sysfs_emit(buf, "%s\n", __stringify(ADXL367_FIFO_MAX_WATERMARK)); 1198 - } 1199 - 1200 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0); 1201 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0); 1186 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "1"); 1187 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max, 1188 + __stringify(ADXL367_FIFO_MAX_WATERMARK)); 1202 1189 static IIO_DEVICE_ATTR(hwfifo_watermark, 0444, 1203 1190 adxl367_get_fifo_watermark, NULL, 0); 1204 1191 static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,