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: bmc150-accel-core: 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/b1b0d662705b43d68594639fb7719bc431101f79.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Matti Vaittinen and committed by
Jonathan Cameron
c02b2a51 f7e68045

+3 -16
+3 -16
drivers/iio/accel/bmc150-accel-core.c
··· 925 925 { } 926 926 }; 927 927 928 - static ssize_t hwfifo_watermark_min_show(struct device *dev, 929 - struct device_attribute *attr, 930 - char *buf) 931 - { 932 - return sysfs_emit(buf, "%s\n", "1"); 933 - } 934 - 935 - static ssize_t hwfifo_watermark_max_show(struct device *dev, 936 - struct device_attribute *attr, 937 - char *buf) 938 - { 939 - return sysfs_emit(buf, "%s\n", __stringify(BMC150_ACCEL_FIFO_LENGTH)); 940 - } 941 - 942 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0); 943 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0); 928 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "1"); 929 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max, 930 + __stringify(BMC150_ACCEL_FIFO_LENGTH)); 944 931 static IIO_DEVICE_ATTR(hwfifo_enabled, S_IRUGO, 945 932 bmc150_accel_get_fifo_state, NULL, 0); 946 933 static IIO_DEVICE_ATTR(hwfifo_watermark, S_IRUGO,