This patch doesn't change the original behavior, just change the name of the function, so there is no regression.
ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
- rc = i2c_nuvoton_wait_for_data_avail(chip,
+ duration = tpm1_calc_ordinal_duration(chip, ordinal);
This version of the patch didn't address my previous comment - "The original
code in the nuvoton driver does not differentiate between TPM 1.2 and TPM
2.0 as it does in tpm_tis_core.c.
Before making any changes, I would first fix it, so that it could easily be
backported. Only then do the refactoring."
I would suggest there is another bug in those drivers/devices that is orthogonal to this refactoring and should not block this from merging.
According to what you say it can call just tpm_calc_oridnal_duration() instead of tpm1_calc_ordinal_duration(chip, ordinal),
but I prefer that someone that has those devices will do that change on top of this series as I cannot test it.