[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZFtMGTLiivnlrN1e@surfacebook>
Date: Wed, 10 May 2023 10:47:37 +0300
From: andy.shevchenko@...il.com
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: 'Piotr Raczynski' <piotr.raczynski@...el.com>, netdev@...r.kernel.org,
jarkko.nikula@...ux.intel.com, andriy.shevchenko@...ux.intel.com,
mika.westerberg@...ux.intel.com, jsd@...ihalf.com,
Jose.Abreu@...opsys.com, andrew@...n.ch, hkallweit1@...il.com,
linux@...linux.org.uk, linux-i2c@...r.kernel.org,
linux-gpio@...r.kernel.org, mengyuanlou@...-swift.com
Subject: Re: [PATCH net-next v7 2/9] i2c: designware: Add driver support for
Wangxun 10Gb NIC
Wed, May 10, 2023 at 02:43:50PM +0800, Jiawen Wu kirjoitti:
> On Tuesday, May 9, 2023 9:52 PM, Piotr Raczynski wrote:
> > On Tue, May 09, 2023 at 10:27:27AM +0800, Jiawen Wu wrote:
...
> > > /*
> > > - * Initiate I2C message transfer when AMD NAVI GPU card is enabled,
> > > + * Initiate I2C message transfer when polling mode is enabled,
> > > * As it is polling based transfer mechanism, which does not support
> > > * interrupt based functionalities of existing DesignWare driver.
> > > */
> > > - if ((dev->flags & MODEL_MASK) == MODEL_AMD_NAVI_GPU) {
> > > + switch (dev->flags & MODEL_MASK) {
> > > + case MODEL_AMD_NAVI_GPU:
> > > ret = amd_i2c_dw_xfer_quirk(adap, msgs, num);
> > > goto done_nolock;
> > > + case MODEL_WANGXUN_SP:
> > > + ret = txgbe_i2c_dw_xfer_quirk(adap, msgs, num);
> > > + goto done_nolock;
> > > + default:
> > > + break;
> > > }
> > Nit pick, when I first saw above code it looked a little weird,
> > maybe it would be a little clearer with:
> >
> > if (i2c_dw_is_model_poll(dev)) {
> > switch (dev->flags & MODEL_MASK) {
> > case MODEL_AMD_NAVI_GPU:
> > ret = amd_i2c_dw_xfer_quirk(adap, msgs, num);
> > break;
> > case MODEL_WANGXUN_SP:
> > ret = txgbe_i2c_dw_xfer_quirk(adap, msgs, num);
> > break;
> > default:
> > break;
> > }
> > goto done_nolock;
> > }
> >
> > I do not insist though.
>
> Sure, it looks more obvious as polling mode quirk.
I don't think we need a double checks. The i2c_dw_is_model_poll() will repeat
the switch. Please, leave it as is in your current version.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists