diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-03-08 06:17:13 -0400 |
---|---|---|
committer | Peter Huewe <peterhuewe@gmx.de> | 2015-03-18 17:43:05 -0400 |
commit | fe7d36859f25cec5029fb4f26e40db2fea623906 (patch) | |
tree | 32f66d0757a99618cf0c7f77116b33f57601d1e9 /drivers | |
parent | 34d47b6322087665be33ca3aa81775b143a4d7ac (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tpm/tpm_i2c_stm_st33.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c index 612845b36c29..882c60a433fd 100644 --- a/drivers/char/tpm/tpm_i2c_stm_st33.c +++ b/drivers/char/tpm/tpm_i2c_stm_st33.c | |||
@@ -837,11 +837,14 @@ static int tpm_stm_i2c_remove(struct i2c_client *client) | |||
837 | */ | 837 | */ |
838 | static int tpm_stm_i2c_pm_suspend(struct device *dev) | 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 | int ret = 0; | 842 | int ret = 0; |
842 | 843 | ||
843 | if (gpio_is_valid(pin_infos->io_lpcpd)) | 844 | tpm_dev = (struct tpm_stm_dev *)TPM_VPRIV(chip); |
844 | gpio_set_value(pin_infos->io_lpcpd, 0); | 845 | |
846 | if (gpio_is_valid(tpm_dev->io_lpcpd)) | ||
847 | gpio_set_value(tpm_dev->io_lpcpd, 0); | ||
845 | else | 848 | else |
846 | ret = tpm_pm_suspend(dev); | 849 | ret = tpm_pm_suspend(dev); |
847 | 850 | ||
@@ -856,12 +859,13 @@ static int tpm_stm_i2c_pm_suspend(struct device *dev) | |||
856 | static int tpm_stm_i2c_pm_resume(struct device *dev) | 859 | static int tpm_stm_i2c_pm_resume(struct device *dev) |
857 | { | 860 | { |
858 | struct tpm_chip *chip = dev_get_drvdata(dev); | 861 | struct tpm_chip *chip = dev_get_drvdata(dev); |
859 | struct st33zp24_platform_data *pin_infos = dev->platform_data; | 862 | struct tpm_stm_dev *tpm_dev; |
860 | |||
861 | int ret = 0; | 863 | int ret = 0; |
862 | 864 | ||
863 | if (gpio_is_valid(pin_infos->io_lpcpd)) { | 865 | tpm_dev = (struct tpm_stm_dev *)TPM_VPRIV(chip); |
864 | gpio_set_value(pin_infos->io_lpcpd, 1); | 866 | |
867 | if (gpio_is_valid(tpm_dev->io_lpcpd)) { | ||
868 | gpio_set_value(tpm_dev->io_lpcpd, 1); | ||
865 | ret = wait_for_stat(chip, | 869 | ret = wait_for_stat(chip, |
866 | TPM_STS_VALID, chip->vendor.timeout_b, | 870 | TPM_STS_VALID, chip->vendor.timeout_b, |
867 | &chip->vendor.read_queue, false); | 871 | &chip->vendor.read_queue, false); |