diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2016-03-31 23:57:00 +0300 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-06-25 17:26:35 +0300 |
commit | 9e0d39d8a6a0a8805d05fba22e3fbe80b5c8c4cb (patch) | |
tree | b070f2d85c9c98bb35202bce5cc4c09ea9308aed /drivers/char/tpm/st33zp24/spi.c | |
parent | af782f339a5d6ea202652c9f06880e1a28c43813 (diff) | |
download | linux-9e0d39d8a6a0a8805d05fba22e3fbe80b5c8c4cb.tar.xz |
tpm: Remove useless priv field in struct tpm_vendor_specific
Remove useless priv field in struct tpm_vendor_specific and take benefit
of chip->dev.driver_data. As priv is the latest field available in
struct tpm_vendor_specific, remove any reference to that structure.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm/st33zp24/spi.c')
-rw-r--r-- | drivers/char/tpm/st33zp24/spi.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c index 608dbc620b18..9f5a0117098c 100644 --- a/drivers/char/tpm/st33zp24/spi.c +++ b/drivers/char/tpm/st33zp24/spi.c @@ -26,6 +26,7 @@ #include <linux/tpm.h> #include <linux/platform_data/st33zp24.h> +#include "../tpm.h" #include "st33zp24.h" #define TPM_DATA_FIFO 0x24 @@ -231,7 +232,9 @@ static const struct st33zp24_phy_ops spi_phy_ops = { static int st33zp24_spi_acpi_request_resources(struct spi_device *spi_dev) { - struct st33zp24_spi_phy *phy = spi_get_drvdata(spi_dev); + struct tpm_chip *chip = spi_get_drvdata(spi_dev); + struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); + struct st33zp24_spi_phy *phy = tpm_dev->phy_id; struct gpio_desc *gpiod_lpcpd; struct device *dev = &spi_dev->dev; @@ -256,7 +259,9 @@ static int st33zp24_spi_acpi_request_resources(struct spi_device *spi_dev) static int st33zp24_spi_of_request_resources(struct spi_device *spi_dev) { - struct st33zp24_spi_phy *phy = spi_get_drvdata(spi_dev); + struct tpm_chip *chip = spi_get_drvdata(spi_dev); + struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); + struct st33zp24_spi_phy *phy = tpm_dev->phy_id; struct device_node *pp; int gpio; int ret; @@ -294,7 +299,9 @@ static int st33zp24_spi_of_request_resources(struct spi_device *spi_dev) static int st33zp24_spi_request_resources(struct spi_device *dev) { - struct st33zp24_spi_phy *phy = spi_get_drvdata(dev); + struct tpm_chip *chip = spi_get_drvdata(dev); + struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); + struct st33zp24_spi_phy *phy = tpm_dev->phy_id; struct st33zp24_platform_data *pdata; int ret; @@ -347,8 +354,6 @@ static int st33zp24_spi_probe(struct spi_device *dev) phy->spi_device = dev; - spi_set_drvdata(dev, phy); - pdata = dev->dev.platform_data; if (!pdata && dev->dev.of_node) { ret = st33zp24_spi_of_request_resources(dev); |