Re: [PATCH net-next v7 2/9] i2c: designware: Add driver support for Wangxun 10Gb NIC

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

 



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





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux