diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2013-10-05 13:40:19 -0400 |
---|---|---|
committer | Peter Huewe <peterhuewe@gmx.de> | 2013-10-22 13:42:35 -0400 |
commit | d0a40174efb0b9d232ccd1cf127cb90a2120f55b (patch) | |
tree | 7d86946113fb9c444e1f50583515181b92c7f11e /drivers/char | |
parent | 58c09e21332c4ab56ac694a71f6715db2768f53f (diff) |
tpm: Remove redundant dev_set_drvdata
TPM drivers should not call dev_set_drvdata (or aliases), only the core
code is allowed to call dev_set_drvdata, and it does it during
tpm_register_hardware.
These extra sets are harmless, but are an anti-pattern that many drivers
have copied.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Joel Schopp <jschopp@linux.vnet.ibm.com>
Reviewed-by: Peter Huewe <peterhuewe@gmx.de>
Acked-by: Ashley Lai <adlai@linux.vnet.ibm.com>
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/tpm_i2c_infineon.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_i2c_stm_st33.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/xen-tpmfront.c | 2 |
3 files changed, 0 insertions, 6 deletions
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c index b8735de8ce95..e33d8e551eff 100644 --- a/drivers/char/tpm/tpm_i2c_infineon.c +++ b/drivers/char/tpm/tpm_i2c_infineon.c | |||
@@ -685,7 +685,6 @@ out_vendor: | |||
685 | chip->dev->release = NULL; | 685 | chip->dev->release = NULL; |
686 | chip->release = NULL; | 686 | chip->release = NULL; |
687 | tpm_dev.client = NULL; | 687 | tpm_dev.client = NULL; |
688 | dev_set_drvdata(chip->dev, chip); | ||
689 | out_err: | 688 | out_err: |
690 | return rc; | 689 | return rc; |
691 | } | 690 | } |
@@ -766,7 +765,6 @@ static int tpm_tis_i2c_remove(struct i2c_client *client) | |||
766 | chip->dev->release = NULL; | 765 | chip->dev->release = NULL; |
767 | chip->release = NULL; | 766 | chip->release = NULL; |
768 | tpm_dev.client = NULL; | 767 | tpm_dev.client = NULL; |
769 | dev_set_drvdata(chip->dev, chip); | ||
770 | 768 | ||
771 | return 0; | 769 | return 0; |
772 | } | 770 | } |
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c index 5bb8e2ddd3b3..1c68d9317aba 100644 --- a/drivers/char/tpm/tpm_i2c_stm_st33.c +++ b/drivers/char/tpm/tpm_i2c_stm_st33.c | |||
@@ -746,8 +746,6 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
746 | 746 | ||
747 | tpm_get_timeouts(chip); | 747 | tpm_get_timeouts(chip); |
748 | 748 | ||
749 | i2c_set_clientdata(client, chip); | ||
750 | |||
751 | dev_info(chip->dev, "TPM I2C Initialized\n"); | 749 | dev_info(chip->dev, "TPM I2C Initialized\n"); |
752 | return 0; | 750 | return 0; |
753 | _irq_set: | 751 | _irq_set: |
diff --git a/drivers/char/tpm/xen-tpmfront.c b/drivers/char/tpm/xen-tpmfront.c index 7a7929ba2658..9b483705694e 100644 --- a/drivers/char/tpm/xen-tpmfront.c +++ b/drivers/char/tpm/xen-tpmfront.c | |||
@@ -386,8 +386,6 @@ static int tpmfront_probe(struct xenbus_device *dev, | |||
386 | 386 | ||
387 | tpm_get_timeouts(priv->chip); | 387 | tpm_get_timeouts(priv->chip); |
388 | 388 | ||
389 | dev_set_drvdata(&dev->dev, priv->chip); | ||
390 | |||
391 | return rv; | 389 | return rv; |
392 | } | 390 | } |
393 | 391 | ||