Re: [PATCH v3 4/4] staging: iio: adc: ad7816: use modern IIO attribute macros

From: Andy Shevchenko

Date: Tue Mar 31 2026 - 03:59:26 EST


On Tue, Mar 31, 2026 at 12:17:10AM +0600, Md. Mahmudul Hasan Mabud wrote:
> Modernize the driver by using IIO_DEVICE_ATTR_RW and

IIO_DEVICE_ATTR_RW()

> IIO_DEVICE_ATTR_RO macros. This involves renaming the callback

IIO_DEVICE_ATTR_RO()

> functions to standard <name>_show and <name>_store formats, making

"...<name>_show() and <name>_store()..."

> the code cleaner and more maintainable.

...

> -static ssize_t ad7816_show_mode(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> +static ssize_t mode_show(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)

You can use room on the previous line(s)

static ssize_t mode_show(struct device *dev, struct device_attribute *attr,
char *buf)

...

> -static ssize_t ad7816_store_mode(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf,
> - size_t len)
> +static ssize_t mode_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf,
> + size_t len)

static ssize_t mode_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t len)

And so on...

...

> -static ssize_t ad7816_show_available_modes(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> +static ssize_t available_modes_show(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)

This is okay to leave as is, as it might be too long (over 80).

--
With Best Regards,
Andy Shevchenko