lkml.org 
[lkml]   [2022]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 1/2] iio: pressure: dps310: Refactor startup procedure
On Tue, May 24, 2022 at 10:35 PM Eddie James <eajames@linux.ibm.com> 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

\
 
 \ /
  Last update: 2022-05-25 18:36    [W:0.075 / U:1.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site