mbox series

[0/3] i2c: rcar: refactor flags

Message ID 20220520202918.17889-1-wsa+renesas@sang-engineering.com
Headers show
Series i2c: rcar: refactor flags | expand

Message

Wolfram Sang May 20, 2022, 8:29 p.m. UTC
First patch is a cleanup to aid further improvements. Patch 2 moves a
persistent-flag to non-persistent. Patch 3 turns a bool variable to
another flag. Thanks go to Morimoto-san for patch 3.

Tested on a Renesas Lager board with R-Car Gen2. To get all the
dependencies, pull this branch:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/i2c/refactor-flags

Looking forward to comments!

Happy hacking,

   Wolfram

Kuninori Morimoto (1):
  i2c: rcar: use flags instead of atomic_xfer

Wolfram Sang (2):
  i2c: rcar: use BIT macro consistently
  i2c: rcar: REP_AFTER_RD is not a persistent flag

 drivers/i2c/busses/i2c-rcar.c | 103 +++++++++++++++++-----------------
 1 file changed, 51 insertions(+), 52 deletions(-)

Comments

Wolfram Sang May 21, 2022, 10:56 a.m. UTC | #1
On Fri, May 20, 2022 at 10:29:17PM +0200, Wolfram Sang wrote:
> Previous refactoring makes it easy now to convert the above flag to a
> non-persistent one. This is more apropriate and easier to maintain.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to for-next, thanks!
Wolfram Sang May 21, 2022, 10:56 a.m. UTC | #2
On Fri, May 20, 2022 at 10:29:18PM +0200, Wolfram Sang wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> i2c-rcar already has priv->flags. This patch adds a new persistent flag
> ID_P_NOT_ATOMIC and uses it to save the extra variable. The negation of
> the logic was done to make the code more readable.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> [wsa: negated the logic, rebased, updated the commit message]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Applied to for-next, thanks!