From: Dmitry Torokhov Date: Wed, 7 Dec 2022 01:44:57 +0000 (-0800) Subject: tpm: st33zp24: remove pointless checks on probe X-Git-Tag: v6.6.7~4025^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eaabc245b02a0e0063068178624d2fc12ba91d69;p=platform%2Fkernel%2Flinux-starfive.git tpm: st33zp24: remove pointless checks on probe Remove tests for SPI device or I2C client to be non-NULL because driver core will never call driver's probe method without having a valid device structure. Signed-off-by: Dmitry Torokhov Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c index 614c7d8..8156bb2 100644 --- a/drivers/char/tpm/st33zp24/i2c.c +++ b/drivers/char/tpm/st33zp24/i2c.c @@ -106,12 +106,6 @@ static int st33zp24_i2c_probe(struct i2c_client *client, { struct st33zp24_i2c_phy *phy; - if (!client) { - pr_info("%s: i2c client is NULL. Device not accessible.\n", - __func__); - return -ENODEV; - } - if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_info(&client->dev, "client not i2c capable\n"); return -ENODEV; diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c index ff4adbe..2154059 100644 --- a/drivers/char/tpm/st33zp24/spi.c +++ b/drivers/char/tpm/st33zp24/spi.c @@ -223,13 +223,6 @@ static int st33zp24_spi_probe(struct spi_device *dev) { struct st33zp24_spi_phy *phy; - /* Check SPI platform functionnalities */ - if (!dev) { - pr_info("%s: dev is NULL. Device is not accessible.\n", - __func__); - return -ENODEV; - } - phy = devm_kzalloc(&dev->dev, sizeof(struct st33zp24_spi_phy), GFP_KERNEL); if (!phy)