mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-04 00:15:49 -04:00
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>
This commit is contained in:
committed by
Jonathan Cameron
parent
2cc64a23c4
commit
f0ab171b80
@@ -1183,22 +1183,9 @@ static ssize_t adxl367_get_fifo_watermark(struct device *dev,
|
||||
return sysfs_emit(buf, "%d\n", fifo_watermark);
|
||||
}
|
||||
|
||||
static ssize_t hwfifo_watermark_min_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", "1");
|
||||
}
|
||||
|
||||
static ssize_t hwfifo_watermark_max_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%s\n", __stringify(ADXL367_FIFO_MAX_WATERMARK));
|
||||
}
|
||||
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0);
|
||||
static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0);
|
||||
IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "1");
|
||||
IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max,
|
||||
__stringify(ADXL367_FIFO_MAX_WATERMARK));
|
||||
static IIO_DEVICE_ATTR(hwfifo_watermark, 0444,
|
||||
adxl367_get_fifo_watermark, NULL, 0);
|
||||
static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,
|
||||
|
||||
Reference in New Issue
Block a user