提交 d0a40174 编写于 作者: J Jason Gunthorpe 提交者: Peter Huewe

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: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: NJoel Schopp <jschopp@linux.vnet.ibm.com>
Reviewed-by: NPeter Huewe <peterhuewe@gmx.de>
Acked-by: NAshley Lai <adlai@linux.vnet.ibm.com>
Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
上级 58c09e21
...@@ -685,7 +685,6 @@ static int tpm_tis_i2c_init(struct device *dev) ...@@ -685,7 +685,6 @@ static int tpm_tis_i2c_init(struct device *dev)
chip->dev->release = NULL; chip->dev->release = NULL;
chip->release = NULL; chip->release = NULL;
tpm_dev.client = NULL; tpm_dev.client = NULL;
dev_set_drvdata(chip->dev, chip);
out_err: out_err:
return rc; return rc;
} }
...@@ -766,7 +765,6 @@ static int tpm_tis_i2c_remove(struct i2c_client *client) ...@@ -766,7 +765,6 @@ static int tpm_tis_i2c_remove(struct i2c_client *client)
chip->dev->release = NULL; chip->dev->release = NULL;
chip->release = NULL; chip->release = NULL;
tpm_dev.client = NULL; tpm_dev.client = NULL;
dev_set_drvdata(chip->dev, chip);
return 0; return 0;
} }
......
...@@ -746,8 +746,6 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -746,8 +746,6 @@ tpm_st33_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
tpm_get_timeouts(chip); tpm_get_timeouts(chip);
i2c_set_clientdata(client, chip);
dev_info(chip->dev, "TPM I2C Initialized\n"); dev_info(chip->dev, "TPM I2C Initialized\n");
return 0; return 0;
_irq_set: _irq_set:
......
...@@ -386,8 +386,6 @@ static int tpmfront_probe(struct xenbus_device *dev, ...@@ -386,8 +386,6 @@ static int tpmfront_probe(struct xenbus_device *dev,
tpm_get_timeouts(priv->chip); tpm_get_timeouts(priv->chip);
dev_set_drvdata(&dev->dev, priv->chip);
return rv; return rv;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册