On Fri Jan 18 19, Jarkko Sakkinen wrote:
On Mon, Jan 14, 2019 at 12:39:40PM -0700, Jerry Snitselaar wrote:
Alexey was following the example of tpm_tis_update_timeouts() which
returns true if the timeouts were updated, and otherwise returns
false. The bool here makes sense to me, but what rc would you suggest
in this case?
Maybe the pattern used there is not that great then.
The callback should simply be update_durations(chip), and it would do
whatever updates needed and either return zero or -errno. And of course
update durations_adjusted flag because that is needed in sysfs.
/Jarkko
Taking a quick look, they already track whether the adjustment
occurred in the tpm_chip struct, so that could be used instead for
what the bool return was being used for. I'll post a patch for the
timeout updates code, and work with Alexey to rework his patchset.
Regards,
Jerry