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: at91-sama5d2_adc: 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>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/4476a4ce852febb3eb863878e66751c787195b18.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Matti Vaittinen and committed by
Jonathan Cameron
c1531e3a c02b2a51

+3 -16
+3 -16
drivers/iio/adc/at91-sama5d2_adc.c
··· 2193 2193 return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark); 2194 2194 } 2195 2195 2196 - static ssize_t hwfifo_watermark_min_show(struct device *dev, 2197 - struct device_attribute *attr, 2198 - char *buf) 2199 - { 2200 - return sysfs_emit(buf, "%s\n", "2"); 2201 - } 2202 - 2203 - static ssize_t hwfifo_watermark_max_show(struct device *dev, 2204 - struct device_attribute *attr, 2205 - char *buf) 2206 - { 2207 - return sysfs_emit(buf, "%s\n", AT91_HWFIFO_MAX_SIZE_STR); 2208 - } 2209 - 2210 2196 static IIO_DEVICE_ATTR(hwfifo_enabled, 0444, 2211 2197 at91_adc_get_fifo_state, NULL, 0); 2212 2198 static IIO_DEVICE_ATTR(hwfifo_watermark, 0444, 2213 2199 at91_adc_get_watermark, NULL, 0); 2214 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0); 2215 - static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0); 2200 + 2201 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "2"); 2202 + IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max, AT91_HWFIFO_MAX_SIZE_STR); 2216 2203 2217 2204 static const struct attribute *at91_adc_fifo_attributes[] = { 2218 2205 &iio_dev_attr_hwfifo_watermark_min.dev_attr.attr,