[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZDVwrEZh1y88Hw8b@smile.fi.intel.com>
Date: Tue, 11 Apr 2023 17:37:32 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: William Breathitt Gray <william.gray@...aro.org>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] counter: 104-quad-8: Migrate to the regmap API
On Mon, Apr 10, 2023 at 10:12:52AM -0400, William Breathitt Gray wrote:
> The regmap API supports IO port accessors so we can take advantage of
> regmap abstractions rather than handling access to the device registers
> directly in the driver.
Looking at the statistics it's a bit unfortunate that LoCs are risen,
perhaps you can add more points why regmap is better than direct IO
accessors.
...
> + int state;
state...
> + state = regmap_test_bits(priv->map, QUAD8_INDEX_INPUT_LEVELS, BIT(signal->id - 16));
> + if (state < 0)
> + return state;
...
> + int ret;
ret...
> + ret = regmap_write(priv->map, QUAD8_CONTROL(count->id),
> + SELECT_RLD | RESET_BP | TRANSFER_CNTR_TO_OL);
> + if (ret)
> + goto exit_unlock;
...
> + int err;
err...
> + err = regmap_write(priv->map, QUAD8_CONTROL(id), SELECT_RLD | RESET_BP);
> + if (err)
> + return err;
...
Maybe a bit of consistency?
...
> + int err;
> + unsigned int status;
> unsigned long irq_status;
> unsigned long channel;
> unsigned int flg_pins;
> u8 event;
Perhaps longer lines first? Hence
int ret;
to be here.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists