mfd: stmpe: Make stmpe_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 12 Oct 2021 15:39:34 +0000 (17:39 +0200)
committerLee Jones <lee.jones@linaro.org>
Fri, 5 Nov 2021 14:40:26 +0000 (14:40 +0000)
Up to now stmpe_remove() returns zero unconditionally. Make it return
void 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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211012153945.2651412-10-u.kleine-koenig@pengutronix.de
drivers/mfd/stmpe-i2c.c
drivers/mfd/stmpe-spi.c
drivers/mfd/stmpe.c
drivers/mfd/stmpe.h

index cd2f45257dc165f6ece99cd24dfc2efbd6be7c8d..d3eedf3d607eaf89882f57af972e14c32c059112 100644 (file)
@@ -95,7 +95,9 @@ static int stmpe_i2c_remove(struct i2c_client *i2c)
 {
        struct stmpe *stmpe = dev_get_drvdata(&i2c->dev);
 
-       return stmpe_remove(stmpe);
+       stmpe_remove(stmpe);
+
+       return 0;
 }
 
 static const struct i2c_device_id stmpe_i2c_id[] = {
index 7351734f759385e372d89fd95bbf0dbd3eb7e2e0..6c5915016be500002bfc95fc2d8efd0168d2bb97 100644 (file)
@@ -106,7 +106,9 @@ static int stmpe_spi_remove(struct spi_device *spi)
 {
        struct stmpe *stmpe = spi_get_drvdata(spi);
 
-       return stmpe_remove(stmpe);
+       stmpe_remove(stmpe);
+
+       return 0;
 }
 
 static const struct of_device_id stmpe_spi_of_match[] = {
index 58d09c615e673fbeb6f668eef8fe9a650c3dfdaa..e928df95e3167e6a4ca7d77c53235c7f78b68e99 100644 (file)
@@ -1496,7 +1496,7 @@ int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum)
        return ret;
 }
 
-int stmpe_remove(struct stmpe *stmpe)
+void stmpe_remove(struct stmpe *stmpe)
 {
        if (!IS_ERR(stmpe->vio))
                regulator_disable(stmpe->vio);
@@ -1506,8 +1506,6 @@ int stmpe_remove(struct stmpe *stmpe)
        __stmpe_disable(stmpe, STMPE_BLOCK_ADC);
 
        mfd_remove_devices(stmpe->dev);
-
-       return 0;
 }
 
 #ifdef CONFIG_PM
index 83491e99ba3c1970541ecc3d6e6639191bcdc473..1b4f91d03bbf48c5bea8528803094a2507c3076a 100644 (file)
@@ -98,7 +98,7 @@ struct stmpe_client_info {
 };
 
 int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum);
-int stmpe_remove(struct stmpe *stmpe);
+void stmpe_remove(struct stmpe *stmpe);
 
 #define STMPE_ICR_LSB_HIGH     (1 << 2)
 #define STMPE_ICR_LSB_EDGE     (1 << 1)