tpm: st33zp24: remove pointless checks on probe
Subsystems (2)
PATCH RESEND v3 1/1 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.
---
v3: no changes
v2: reworked commit message
This was a part of a 3-patch series, the first 2 dealt with dropping support for platform data and converting the driver to gpiod API, and were applied, this one got reviewed-by from Jarkko but for some reason was left out.
drivers/char/tpm/st33zp24/i2c.c | 6 ------ drivers/char/tpm/st33zp24/spi.c | 7 ------- 2 files changed, 13 deletions(-)
drivers/char/tpm/st33zp24/i2c.c +0 -6
@@ -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 ;
drivers/char/tpm/st33zp24/spi.c +0 -7
@@ -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)
Signature · 5 lines
2.39.0.rc0.267.gcb52ba06e7-goog -- Dmitry
Quoted 61 lines · Dmitry Torokhov
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.
Reviewed-by Jarkko Sakkinen <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>---
v3: no changes
v2: reworked commit messageThis was a part of a 3-patch series, the first 2 dealt with dropping support for platform data and converting the driver to gpiod API, and were applied, this one got reviewed-by from Jarkko but for some reason was left out.
drivers/char/tpm/st33zp24/i2c.c | 6 ------ drivers/char/tpm/st33zp24/spi.c | 7 ------- 2 files changed, 13 deletions(-)drivers/char/tpm/st33zp24/i2c.c +0
-6@@ -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 ;drivers/char/tpm/st33zp24/spi.c +0
-7@@ -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)Signature · 5 lines
2.39.0.rc0.267.gcb52ba06e7-goog -- Dmitry
Thanks, applied.
BR, Jarkko