RE: [PATCH v2 4/7] can: rcar_canfd: Add gen4_type variable to struct rcar_canfd_hw_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: 24 February 2025 10:12
> Subject: Re: [PATCH v2 4/7] can: rcar_canfd: Add gen4_type variable to struct rcar_canfd_hw_info
> 
> Hi Biju,
> 
> On Thu, 20 Feb 2025 at 14:04, Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > Both R-Car Gen4 and RZ/G3E SoCs have similar register layout.
> > Introduce gen4_type variable to struct rcar_canfd_hw_info for the
> > preparation of adding RZ/G3E driver support.
> >
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> 
> Thanks for your patch!
> 
> > --- a/drivers/net/can/rcar/rcar_canfd.c
> > +++ b/drivers/net/can/rcar/rcar_canfd.c
> > @@ -516,6 +516,7 @@ struct rcar_canfd_hw_info {
> >         /* hardware features */
> >         unsigned shared_global_irqs:1;  /* Has shared global irqs */
> >         unsigned multi_channel_irqs:1;  /* Has multiple channel irqs
> > */
> > +       unsigned gen4_type:1;           /* Has gen4 type reg layout */
> 
> Perhaps this can be replaced by a (or more) more descriptive feature flags, like you did before when
> introducing rcar_canfd_hw_info?

OK, Looking at commit log and hardware manual will do this change to add more descriptive feature flags.


> 
> >  };
> >
> >  /* Channel priv data */
> > @@ -596,6 +597,7 @@ static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
> >         .max_channels = 8,
> >         .postdiv = 2,
> >         .shared_global_irqs = 1,
> > +       .gen4_type = 1,
> >  };
> >
> >  static const struct rcar_canfd_hw_info rzg2l_hw_info = { @@ -607,7
> > +609,7 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
> >  /* Helper functions */
> >  static inline bool is_gen4(struct rcar_canfd_global *gpriv)  {
> > -       return gpriv->info == &rcar_gen4_hw_info;
> > +       return gpriv->info->gen4_type;
> >  }
> 
> And hopefully we can get rid of is_gen4() in the process, too...

Agreed.

Cheers,
Biju

> 
> >
> >  static inline u32 reg_gen4(struct rcar_canfd_global *gpriv,
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
> 
> In personal conversations with technical people, I call myself a hacker. But when I'm talking to
> journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux