tpm: st33zp24: Make st33zp24_remove() a void function
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 23 Jan 2022 17:51:59 +0000 (18:51 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 9 Feb 2022 13:00:42 +0000 (13:00 +0000)
Up to now st33zp24_remove() returns zero unconditionally. Make it return
no value instead which makes it easier to see in the callers that there is
no error to handle.

Also the return value of i2c and spi remove callbacks is ignored anyway.

Link: https://lore.kernel.org/r/20220104231103.227924-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220123175201.34839-4-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/char/tpm/st33zp24/i2c.c
drivers/char/tpm/st33zp24/spi.c
drivers/char/tpm/st33zp24/st33zp24.c
drivers/char/tpm/st33zp24/st33zp24.h

index 7c617edff4ca2968ef24fc2ae457233fa433e511..3170d59d660c089182874f6e7bf0df8fbaa03260 100644 (file)
@@ -267,11 +267,8 @@ static int st33zp24_i2c_probe(struct i2c_client *client,
 static int st33zp24_i2c_remove(struct i2c_client *client)
 {
        struct tpm_chip *chip = i2c_get_clientdata(client);
-       int ret;
 
-       ret = st33zp24_remove(chip);
-       if (ret)
-               return ret;
+       st33zp24_remove(chip);
 
        return 0;
 }
index a75dafd3944517dda0eacf52175062dbd5bf9ea4..ccd9e42b8eab4f9cdb9c34e17ae5bc490ef0e9a0 100644 (file)
@@ -384,11 +384,8 @@ static int st33zp24_spi_probe(struct spi_device *dev)
 static int st33zp24_spi_remove(struct spi_device *dev)
 {
        struct tpm_chip *chip = spi_get_drvdata(dev);
-       int ret;
 
-       ret = st33zp24_remove(chip);
-       if (ret)
-               return ret;
+       st33zp24_remove(chip);
 
        return 0;
 }
index ce9efb73c144be2b9cdb4daa77c180d150534811..15b393e92c8eca97960dd3ffab575739ac06731b 100644 (file)
@@ -511,10 +511,9 @@ _tpm_clean_answer:
 }
 EXPORT_SYMBOL(st33zp24_probe);
 
-int st33zp24_remove(struct tpm_chip *chip)
+void st33zp24_remove(struct tpm_chip *chip)
 {
        tpm_chip_unregister(chip);
-       return 0;
 }
 EXPORT_SYMBOL(st33zp24_remove);
 
index 6747be1e250217f48c423e49a96df9f845bd34ac..b387a476c555f3dab199b2372675eede8144cc37 100644 (file)
@@ -34,5 +34,5 @@ int st33zp24_pm_resume(struct device *dev);
 
 int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
                   struct device *dev, int irq, int io_lpcpd);
-int st33zp24_remove(struct tpm_chip *chip);
+void st33zp24_remove(struct tpm_chip *chip);
 #endif /* __LOCAL_ST33ZP24_H__ */