[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aVveR7GEPEaO8juK@smile.fi.intel.com>
Date: Mon, 5 Jan 2026 17:52:39 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Tomas Borquez <tomasborquez13@...il.com>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
Jonathan Cameron <jic23@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, linux-staging@...ts.linux.dev
Subject: Re: [PATCH v2 4/6] staging: iio: ad9832: remove dds.h dependency
On Sun, Jan 04, 2026 at 02:25:23AM -0300, Tomas Borquez wrote:
> On Wed, Dec 31, 2025 at 12:46:28AM +0200, Andy Shevchenko wrote:
> > On Tue, Dec 30, 2025 at 10:35 PM Tomas Borquez <tomasborquez13@...il.com> wrote:
...
> > > +static IIO_DEVICE_ATTR(out_altvoltage0_frequency0, 0200, NULL, ad9832_write, AD9832_FREQ0HM);
> > > +static IIO_DEVICE_ATTR(out_altvoltage0_frequency1, 0200, NULL, ad9832_write, AD9832_FREQ1HM);
> >
> > Any particular point in not using _WO() / _RO() variants of the
> > IIO_DEVICE_ATTR_*() macros?
> I was looking into this and saw that the definition for both _WO() and _RO() only takes _name and _addr:
>
> #define IIO_DEVICE_ATTR_WO(_name, _addr) \
> struct iio_dev_attr iio_dev_attr_##_name = IIO_ATTR_WO(_name, _addr)
>
> So if we use it for frequency0 for example, it assumes the store function
> since we don't pass it:
>
> static IIO_DEVICE_ATTR_WO(out_altvoltage0_frequency0, AD9832_FREQ0HM);
>
> // Expands to
> struct iio_dev_attr iio_dev_attr_out_altvoltage0_frequency0 = {
> .dev_attr = {
> . attr = {
> ...
> .store = out_altvoltage0_frequency0_store,
> }
> }
> }
>
> Meaning we would have to create a store for each one instead of using
> just one write function
Yes, and it will be fine, no? Explicit is better than implicit
(at least in this case).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists