diff mbox

[tpmdd-devel,2/6] tpm/tpm_i2c_atmel: simplify patch to get tpm_chip from an i2c_client

Message ID 1458941160-4437-3-git-send-email-christophe-h.ricard@st.com
State New
Headers show

Commit Message

Christophe Ricard March 25, 2016, 9:25 p.m. UTC
i2c_get_clientdata allows to simplify the current way to retrieve a tpm_chip
structure.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
---
 drivers/char/tpm/tpm_i2c_atmel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c
index f311aaf..5426c9d 100644
--- a/drivers/char/tpm/tpm_i2c_atmel.c
+++ b/drivers/char/tpm/tpm_i2c_atmel.c
@@ -191,8 +191,7 @@  static int i2c_atmel_probe(struct i2c_client *client,
 
 static int i2c_atmel_remove(struct i2c_client *client)
 {
-	struct device *dev = &(client->dev);
-	struct tpm_chip *chip = dev_get_drvdata(dev);
+	struct tpm_chip *chip = i2c_get_clientdata(client);
 	tpm_chip_unregister(chip);
 	return 0;
 }