On Thu, Nov 03, 2022 at 03:54:49PM +0100, Jan Dabros wrote: > Instead of using static functions tpm_cr50_request_locality and > tpm_cr50_release_locality register callbacks from tpm class chip->ops > created for this purpose. > > Signed-off-by: Jan Dabros <jsd@xxxxxxxxxxxx> > --- [ ... ] > #ifdef CONFIG_ACPI > @@ -686,6 +714,7 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client) > u32 vendor; > u8 buf[4]; > int rc; > + int loc; > > if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) > return -ENODEV; > @@ -728,24 +757,30 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client) > TPM_CR50_TIMEOUT_NOIRQ_MS); > } > > - rc = tpm_cr50_request_locality(chip); > - if (rc < 0) { > + loc = tpm_cr50_request_locality(chip, TPM_CR50_I2C_DEFAULT_LOC); > + if (loc < 0) { > dev_err(dev, "Could not request locality\n"); > return rc; As reported by 0-day and Dan Carpenter: return loc; Guenter