linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] char: tpm: cr50_i2c: Drop if with an always false condition
@ 2021-11-12 22:53 Uwe Kleine-König
  2021-11-13 10:53 ` Jarkko Sakkinen
  0 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2021-11-12 22:53 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen; +Cc: Jason Gunthorpe, linux-integrity

tpm_cr50_i2c_remove() is only called after tpm_cr50_i2c_probe() returned
successfully. As i2c_get_clientdata() returns driver data for the
client's device and this was set in tpmm_chip_alloc() it won't return
NULL.

Simplify accordingly to prepare changing the prototype of the i2c remove
callback to return void. Notice that already today returning an error
code from the remove callback doesn't prevent removal.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/char/tpm/tpm_tis_i2c_cr50.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
index c89278103703..622cdf622ddc 100644
--- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
+++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
@@ -751,12 +751,6 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client)
 static int tpm_cr50_i2c_remove(struct i2c_client *client)
 {
 	struct tpm_chip *chip = i2c_get_clientdata(client);
-	struct device *dev = &client->dev;
-
-	if (!chip) {
-		dev_err(dev, "Could not get client data at remove\n");
-		return -ENODEV;
-	}
 
 	tpm_chip_unregister(chip);
 	tpm_cr50_release_locality(chip, true);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-05-04  4:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-12 22:53 [PATCH] char: tpm: cr50_i2c: Drop if with an always false condition Uwe Kleine-König
2021-11-13 10:53 ` Jarkko Sakkinen
2021-11-13 21:53   ` Uwe Kleine-König
2021-11-16 15:55     ` Jarkko Sakkinen
2021-11-16 17:30       ` Uwe Kleine-König
2022-03-31 13:22         ` Uwe Kleine-König
2022-04-25 19:11           ` Uwe Kleine-König
2022-04-26  4:35             ` Jarkko Sakkinen
2022-04-26  8:06               ` [PATCH] char: tpm: cr50_i2c: Suppress duplicated error message in .remove() Uwe Kleine-König
2022-05-04  3:53                 ` Jarkko Sakkinen
2022-05-04  4:06                   ` Jarkko Sakkinen
2022-04-26 11:35               ` [PATCH] char: tpm: cr50_i2c: Drop if with an always false condition Jason Gunthorpe
2022-05-04  4:02                 ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).