iio: gyro: mpu3050: Make mpu3050_common_remove() return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 25 Apr 2022 19:17:35 +0000 (21:17 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 1 May 2022 18:01:13 +0000 (19:01 +0100)
This function (up to now) returns zero unconditionally, so there isn't
any benefit of returning a value. Make it return void to be able to see
at a glance that the return value of mpu3050_i2c_remove is always zero.

This patch is a preparation for making i2c remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220425191735.59032-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/gyro/mpu3050-core.c
drivers/iio/gyro/mpu3050-i2c.c
drivers/iio/gyro/mpu3050.h

index a2dafdb..4f19dc7 100644 (file)
@@ -1263,7 +1263,7 @@ err_power_down:
 }
 EXPORT_SYMBOL(mpu3050_common_probe);
 
-int mpu3050_common_remove(struct device *dev)
+void mpu3050_common_remove(struct device *dev)
 {
        struct iio_dev *indio_dev = dev_get_drvdata(dev);
        struct mpu3050 *mpu3050 = iio_priv(indio_dev);
@@ -1276,8 +1276,6 @@ int mpu3050_common_remove(struct device *dev)
                free_irq(mpu3050->irq, mpu3050);
        iio_device_unregister(indio_dev);
        mpu3050_power_down(mpu3050);
-
-       return 0;
 }
 EXPORT_SYMBOL(mpu3050_common_remove);
 
index ef5bcbc..5b5f58b 100644 (file)
@@ -86,7 +86,9 @@ static int mpu3050_i2c_remove(struct i2c_client *client)
        if (mpu3050->i2cmux)
                i2c_mux_del_adapters(mpu3050->i2cmux);
 
-       return mpu3050_common_remove(&client->dev);
+       mpu3050_common_remove(&client->dev);
+
+       return 0;
 }
 
 /*
index 835b024..faf4168 100644 (file)
@@ -91,7 +91,7 @@ int mpu3050_common_probe(struct device *dev,
                         struct regmap *map,
                         int irq,
                         const char *name);
-int mpu3050_common_remove(struct device *dev);
+void mpu3050_common_remove(struct device *dev);
 
 /* PM ops */
 extern const struct dev_pm_ops mpu3050_dev_pm_ops;