lkml.org 
[lkml]   [2022]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 2/2] i2c: designware: Add AMD PSP I2C bus support
śr., 9 lut 2022 o 16:28 Andy Shevchenko
<andriy.shevchenko@linux.intel.com> napisał(a):
>
> On Tue, Feb 08, 2022 at 03:12:18PM +0100, Jan Dabros wrote:
>
> ...
>
> I have noticed code duplication.
>
> > + status = psp_send_i2c_req(PSP_I2C_REQ_ACQUIRE);
> > + if (status) {
> > + if (status == -ETIMEDOUT)
> > + dev_err(psp_i2c_dev, "Timed out waiting for PSP to release I2C bus\n");
> > + else
> > + dev_err(psp_i2c_dev, "PSP communication error\n");
> > +
> > + dev_err(psp_i2c_dev, "Assume i2c bus is for exclusive host usage\n");
> > + psp_i2c_mbox_fail = true;
> > + goto cleanup;
> > + }
>
> > + /* Send a release command to PSP */
> > + status = psp_send_i2c_req(PSP_I2C_REQ_RELEASE);
> > + if (status) {
> > + if (status == -ETIMEDOUT)
> > + dev_err(psp_i2c_dev, "Timed out waiting for PSP to acquire I2C bus\n");
> > + else
> > + dev_err(psp_i2c_dev, "PSP communication error\n");
> > +
> > + dev_err(psp_i2c_dev, "Assume i2c bus is for exclusive host usage\n");
> > + psp_i2c_mbox_fail = true;
> > + goto cleanup;
> > + }
>
> If you are going to update the series, consider to introduce a common helper.
> Otherwise, consider a follow up.

Thanks for your comment. Since Jarkko is running some long-lasting
tests with v4 patchset, I would like to keep this as is for now (and
make a follow up commit). If there will be some additional comments
for v4 from him and will spin v5 - I will introduce a common helper
function then.

Best Regards,
Jan

\
 
 \ /
  Last update: 2022-02-10 09:19    [W:0.094 / U:2.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site