[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zw5OZAhzyhNUTPae@smile.fi.intel.com>
Date: Tue, 15 Oct 2024 14:13:40 +0300
From: Andy Shevchenko <andy@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Antoniu Miclaus <antoniu.miclaus@...log.com>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Nuno Sa <nuno.sa@...log.com>,
Olivier Moysan <olivier.moysan@...s.st.com>,
Uwe Kleine-König <ukleinek@...nel.org>,
Marcelo Schmitt <marcelo.schmitt@...log.com>,
Ivan Mikhaylov <fr0st61te@...il.com>,
Marius Cristea <marius.cristea@...rochip.com>,
Dumitru Ceclan <mitrutzceclan@...il.com>,
João Paulo Gonçalves <joao.goncalves@...adex.com>,
Alisa-Dariana Roman <alisadariana@...il.com>,
Mike Looijmans <mike.looijmans@...ic.nl>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Sergiu Cuciurean <sergiu.cuciurean@...log.com>,
Dragos Bogdan <dragos.bogdan@...log.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org
Subject: Re: [PATCH v3 6/6] iio: adc: ad4851: add ad485x driver
On Mon, Oct 14, 2024 at 05:08:47PM -0500, David Lechner wrote:
> On 10/14/24 8:14 AM, Andy Shevchenko wrote:
> > On Mon, Oct 14, 2024 at 12:40:40PM +0300, Antoniu Miclaus wrote:
...
> >> + return regmap_update_bits(st->regmap, AD4851_REG_PACKET,
> >> + AD4851_PACKET_FORMAT_MASK, (osr == 1) ? 0 : 1);
> >
> > I would do it with a conditional
> >
> > if (osr ...)
> > return regmap_update_bits(st->regmap, AD4851_REG_PACKET,
> > AD4851_PACKET_FORMAT_MASK, 0);
> >
> > return regmap_update_bits(st->regmap, AD4851_REG_PACKET,
> > AD4851_PACKET_FORMAT_MASK, 1);
> >
> If we do this, regmap_set_bits() and regmap_clear_bits() would
> be even better.
Sure, but I want also to have the only one conditional, so the respective
helper functions can be easily read and followed.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists