[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8uHHM3MY+CpGOmTdc_jn++bgngUqkZgVQgyBfF2jOXHXQ@mail.gmail.com>
Date: Fri, 8 Mar 2024 21:00:47 +0000
From: "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Chris Brandt <chris.brandt@...esas.com>, Andi Shyti <andi.shyti@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
Magnus Damm <magnus.damm@...il.com>, Wolfram Sang <wsa+renesas@...g-engineering.com>,
linux-renesas-soc@...r.kernel.org, linux-i2c@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: [PATCH 3/5] i2c: riic: Introduce helper functions for I2C
read/write operations
Hi Geert,
Thank you for the review.
On Fri, Mar 8, 2024 at 7:47 PM Geert Uytterhoeven <geert@...ux-m68korg> wrote:
>
> Hi Prabhakar,
>
> On Fri, Mar 8, 2024 at 6:28 PM Prabhakar <prabhakar.csengg@...il.com> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> >
> > Introduce helper functions for performing I2C read and write operations
> > in the RIIC driver.
> >
> > These helper functions lay the groundwork for adding support for the
> > RZ/V2H SoC. This is essential because the register offsets for the RZ/V2H
> > SoC differ from those of the RZ/A SoC. By abstracting the read and write
> > operations, we can seamlessly adapt the driver to support different SoC
> > variants without extensive modifications.
> >
> > This patch is part of the preparation process for integrating support for
> > the RZ/V2H SoC into the RIIC driver.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> > Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@...esas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/i2c/busses/i2c-riic.c
> > +++ b/drivers/i2c/busses/i2c-riic.c
> > @@ -105,9 +105,19 @@ struct riic_irq_desc {
> > char *name;
> > };
> >
> > +static inline void riic_writeb_reg(u8 val, struct riic_dev *riic, u8 offset)
>
> Having "riic" in the middle is definitely the wrong order of parameters ;-)
> Please make "riic" the first parameter.
>
Agreed, will do.
> > +{
> > + writeb(val, riic->base + offset);
> > +}
> > +
> > +static inline u8 riic_readb_reg(struct riic_dev *riic, u8 offset)
> > +{
> > + return readb(riic->base + offset);
> > +}
>
>
> > - writeb(0, riic->base + RIIC_ICSR2);
> > + riic_writeb_reg(0, riic, RIIC_ICSR2);
>
> This clearly shows that the new accessors involve more typing work.
> Why not just call them riic_writeb() and riic_readb()?
>
Ok, I'll rename them to riic_writeb() and riic_readb().
Cheers,
Prabhakar
Powered by blists - more mailing lists