diff options
Diffstat (limited to 'drivers/char/tpm/st33zp24/i2c.c')
-rw-r--r-- | drivers/char/tpm/st33zp24/i2c.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c index f8e8123ca61d..028a9cd76b63 100644 --- a/drivers/char/tpm/st33zp24/i2c.c +++ b/drivers/char/tpm/st33zp24/i2c.c @@ -26,6 +26,7 @@ #include <linux/tpm.h> #include <linux/platform_data/st33zp24.h> +#include "../tpm.h" #include "st33zp24.h" #define TPM_DUMMY_BYTE 0xAA @@ -112,7 +113,9 @@ static const struct st33zp24_phy_ops i2c_phy_ops = { static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client) { - struct st33zp24_i2c_phy *phy = i2c_get_clientdata(client); + struct tpm_chip *chip = i2c_get_clientdata(client); + struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); + struct st33zp24_i2c_phy *phy = tpm_dev->phy_id; struct gpio_desc *gpiod_lpcpd; struct device *dev = &client->dev; @@ -138,7 +141,9 @@ static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client) static int st33zp24_i2c_of_request_resources(struct i2c_client *client) { - struct st33zp24_i2c_phy *phy = i2c_get_clientdata(client); + struct tpm_chip *chip = i2c_get_clientdata(client); + struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); + struct st33zp24_i2c_phy *phy = tpm_dev->phy_id; struct device_node *pp; int gpio; int ret; @@ -176,8 +181,10 @@ static int st33zp24_i2c_of_request_resources(struct i2c_client *client) static int st33zp24_i2c_request_resources(struct i2c_client *client) { + struct tpm_chip *chip = i2c_get_clientdata(client); + struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); + struct st33zp24_i2c_phy *phy = tpm_dev->phy_id; struct st33zp24_platform_data *pdata; - struct st33zp24_i2c_phy *phy = i2c_get_clientdata(client); int ret; pdata = client->dev.platform_data; @@ -234,8 +241,6 @@ static int st33zp24_i2c_probe(struct i2c_client *client, phy->client = client; - i2c_set_clientdata(client, phy); - pdata = client->dev.platform_data; if (!pdata && client->dev.of_node) { ret = st33zp24_i2c_of_request_resources(client); |