Re: [PATCH v3 1/2] iio: pressure: dps310: Refactor startup procedure

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

 



On Tue, May 24, 2022 at 10:35 PM Eddie James <eajames@xxxxxxxxxxxxx> wrote:
>
> Move the startup procedure into a function, and correct a missing
> check on the return code for writing the PRS_CFG register.

...

> +/*
> + * Some verions of chip will read temperatures in the ~60C range when

versions
of the chip(s)

> + * its actually ~20C. This is the manufacturer recommended workaround

it's

> + * to correct the issue. The registers used below are undocumented.
> + */

Yes, they are in the original code, but you may just fix while at it.

...

> +       rc = dps310_temp_workaround(data);
> +       if (rc < 0)

These ' < 0' parts are cargo cult, I believe.
That's why this makes code longer and confusing by "what is the
meaning of the positive values here?"

> +               return rc;
> +
> +       return 0;

That said,

  return dps310_temp_workaround(data);

should suffice.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux