Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tpm/tpm_i2c_stm_st33: Replace access to io_lpcpd from struct st33zp24_platform_data to tpm_stm_dev

io_lpcpd is accessible from struct tpm_stm_dev.
struct st33zp24_platform_data is only valid when using static platform
configuration data, not when using dts.

Reviewed-by: Jason Gunthorpe <jason.gunthorpe@obsidianresearch.com>
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>

authored by

Christophe Ricard and committed by
Peter Huewe
fe7d3685 34d47b63

+11 -7
+11 -7
drivers/char/tpm/tpm_i2c_stm_st33.c
··· 837 837 */ 838 838 static int tpm_stm_i2c_pm_suspend(struct device *dev) 839 839 { 840 - struct st33zp24_platform_data *pin_infos = dev->platform_data; 840 + struct tpm_chip *chip = dev_get_drvdata(dev); 841 + struct tpm_stm_dev *tpm_dev; 841 842 int ret = 0; 842 843 843 - if (gpio_is_valid(pin_infos->io_lpcpd)) 844 - gpio_set_value(pin_infos->io_lpcpd, 0); 844 + tpm_dev = (struct tpm_stm_dev *)TPM_VPRIV(chip); 845 + 846 + if (gpio_is_valid(tpm_dev->io_lpcpd)) 847 + gpio_set_value(tpm_dev->io_lpcpd, 0); 845 848 else 846 849 ret = tpm_pm_suspend(dev); 847 850 ··· 859 856 static int tpm_stm_i2c_pm_resume(struct device *dev) 860 857 { 861 858 struct tpm_chip *chip = dev_get_drvdata(dev); 862 - struct st33zp24_platform_data *pin_infos = dev->platform_data; 863 - 859 + struct tpm_stm_dev *tpm_dev; 864 860 int ret = 0; 865 861 866 - if (gpio_is_valid(pin_infos->io_lpcpd)) { 867 - gpio_set_value(pin_infos->io_lpcpd, 1); 862 + tpm_dev = (struct tpm_stm_dev *)TPM_VPRIV(chip); 863 + 864 + if (gpio_is_valid(tpm_dev->io_lpcpd)) { 865 + gpio_set_value(tpm_dev->io_lpcpd, 1); 868 866 ret = wait_for_stat(chip, 869 867 TPM_STS_VALID, chip->vendor.timeout_b, 870 868 &chip->vendor.read_queue, false);