summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm_atmel.c
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2016-03-31 20:57:00 (GMT)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-06-25 14:26:35 (GMT)
commit9e0d39d8a6a0a8805d05fba22e3fbe80b5c8c4cb (patch)
treeb070f2d85c9c98bb35202bce5cc4c09ea9308aed /drivers/char/tpm/tpm_atmel.c
parentaf782f339a5d6ea202652c9f06880e1a28c43813 (diff)
downloadlinux-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/tpm_atmel.c')
-rw-r--r--drivers/char/tpm/tpm_atmel.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
index b769299..0d322ab 100644
--- a/drivers/char/tpm/tpm_atmel.c
+++ b/drivers/char/tpm/tpm_atmel.c
@@ -37,7 +37,7 @@ enum tpm_atmel_read_status {
static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
{
- struct tpm_atmel_priv *priv = chip->vendor.priv;
+ struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev);
u8 status, *hdr = buf;
u32 size;
int i;
@@ -96,7 +96,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
{
- struct tpm_atmel_priv *priv = chip->vendor.priv;
+ struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev);
int i;
dev_dbg(&chip->dev, "tpm_atml_send:\n");
@@ -110,14 +110,14 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
static void tpm_atml_cancel(struct tpm_chip *chip)
{
- struct tpm_atmel_priv *priv = chip->vendor.priv;
+ struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev);
iowrite8(ATML_STATUS_ABORT, priv->iobase + 1);
}
static u8 tpm_atml_status(struct tpm_chip *chip)
{
- struct tpm_atmel_priv *priv = chip->vendor.priv;
+ struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev);
return ioread8(priv->iobase + 1);
}
@@ -142,7 +142,7 @@ static struct platform_device *pdev;
static void atml_plat_remove(void)
{
struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
- struct tpm_atmel_priv *priv = chip->vendor.priv;
+ struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev);
if (chip) {
tpm_chip_unregister(chip);
@@ -207,7 +207,7 @@ static int __init init_atmel(void)
goto err_unreg_dev;
}
- chip->vendor.priv = priv;
+ dev_set_drvdata(&chip->dev, priv);
rc = tpm_chip_register(chip);
if (rc)