diff options
Diffstat (limited to 'drivers/iio')
80 files changed, 110 insertions, 246 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 9c9e98578667..d03fc3400f94 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -1045,7 +1045,7 @@ err_disable_vdd: return ret; } -static int bma180_remove(struct i2c_client *client) +static void bma180_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct bma180_data *data = iio_priv(indio_dev); @@ -1062,8 +1062,6 @@ static int bma180_remove(struct i2c_client *client) mutex_unlock(&data->mutex); regulator_disable(data->vddio_supply); regulator_disable(data->vdd_supply); - - return 0; } static int bma180_suspend(struct device *dev) diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c index dff4d7dd101c..be8cc598b88e 100644 --- a/drivers/iio/accel/bmc150-accel-i2c.c +++ b/drivers/iio/accel/bmc150-accel-i2c.c @@ -209,13 +209,11 @@ static int bmc150_accel_probe(struct i2c_client *client, return 0; } -static int bmc150_accel_remove(struct i2c_client *client) +static void bmc150_accel_remove(struct i2c_client *client) { bmc150_acpi_dual_accel_remove(client); bmc150_accel_core_remove(&client->dev); - - return 0; } static const struct acpi_device_id bmc150_accel_acpi_match[] = { diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 748b35c2f0c3..94f7b6ac5c87 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1611,7 +1611,7 @@ err_poweroff: return ret; } -static int kxcjk1013_remove(struct i2c_client *client) +static void kxcjk1013_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct kxcjk1013_data *data = iio_priv(indio_dev); @@ -1630,8 +1630,6 @@ static int kxcjk1013_remove(struct i2c_client *client) mutex_lock(&data->mutex); kxcjk1013_set_mode(data, STANDBY); mutex_unlock(&data->mutex); - - return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/iio/accel/kxsd9-i2c.c b/drivers/iio/accel/kxsd9-i2c.c index d57f264bd6c8..61346ea8ef19 100644 --- a/drivers/iio/accel/kxsd9-i2c.c +++ b/drivers/iio/accel/kxsd9-i2c.c @@ -32,11 +32,9 @@ static int kxsd9_i2c_probe(struct i2c_client *i2c, i2c->name); } -static int kxsd9_i2c_remove(struct i2c_client *client) +static void kxsd9_i2c_remove(struct i2c_client *client) { kxsd9_common_remove(&client->dev); - - return 0; } static const struct of_device_id kxsd9_of_match[] = { diff --git a/drivers/iio/accel/mc3230.c b/drivers/iio/accel/mc3230.c index c15d16e7f1da..2462000e0519 100644 --- a/drivers/iio/accel/mc3230.c +++ b/drivers/iio/accel/mc3230.c @@ -151,15 +151,13 @@ static int mc3230_probe(struct i2c_client *client, return ret; } -static int mc3230_remove(struct i2c_client *client) +static void mc3230_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); iio_device_unregister(indio_dev); mc3230_set_opcon(iio_priv(indio_dev), MC3230_MODE_OPCON_STANDBY); - - return 0; } static int mc3230_suspend(struct device *dev) diff --git a/drivers/iio/accel/mma7455_i2c.c b/drivers/iio/accel/mma7455_i2c.c index a3b84e8a3ea8..c63b321b01cd 100644 --- a/drivers/iio/accel/mma7455_i2c.c +++ b/drivers/iio/accel/mma7455_i2c.c @@ -26,11 +26,9 @@ static int mma7455_i2c_probe(struct i2c_client *i2c, return mma7455_core_probe(&i2c->dev, regmap, name); } -static int mma7455_i2c_remove(struct i2c_client *i2c) +static void mma7455_i2c_remove(struct i2c_client *i2c) { mma7455_core_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id mma7455_i2c_ids[] = { diff --git a/drivers/iio/accel/mma7660.c b/drivers/iio/accel/mma7660.c index 794f2f383303..85829990bbad 100644 --- a/drivers/iio/accel/mma7660.c +++ b/drivers/iio/accel/mma7660.c @@ -207,7 +207,7 @@ static int mma7660_probe(struct i2c_client *client, return ret; } -static int mma7660_remove(struct i2c_client *client) +static void mma7660_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); int ret; @@ -218,8 +218,6 @@ static int mma7660_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to put device in stand-by mode (%pe), ignoring\n", ERR_PTR(ret)); - - return 0; } static int mma7660_suspend(struct device *dev) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index c7d9ca96dbaa..3ba28c2ff68a 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1735,7 +1735,7 @@ disable_regulator_vdd: return ret; } -static int mma8452_remove(struct i2c_client *client) +static void mma8452_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mma8452_data *data = iio_priv(indio_dev); @@ -1751,8 +1751,6 @@ static int mma8452_remove(struct i2c_client *client) regulator_disable(data->vddio_reg); regulator_disable(data->vdd_reg); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c index 123cdbbb265c..f7a793f4a8e3 100644 --- a/drivers/iio/accel/mma9551.c +++ b/drivers/iio/accel/mma9551.c @@ -509,7 +509,7 @@ out_poweroff: return ret; } -static int mma9551_remove(struct i2c_client *client) +static void mma9551_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mma9551_data *data = iio_priv(indio_dev); @@ -522,8 +522,6 @@ static int mma9551_remove(struct i2c_client *client) mutex_lock(&data->mutex); mma9551_set_device_state(data->client, false); mutex_unlock(&data->mutex); - - return 0; } static int mma9551_runtime_suspend(struct device *dev) diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c index 09df58d4be33..2da0e005b13e 100644 --- a/drivers/iio/accel/mma9553.c +++ b/drivers/iio/accel/mma9553.c @@ -1148,7 +1148,7 @@ out_poweroff: return ret; } -static int mma9553_remove(struct i2c_client *client) +static void mma9553_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mma9553_data *data = iio_priv(indio_dev); @@ -1161,8 +1161,6 @@ static int mma9553_remove(struct i2c_client *client) mutex_lock(&data->mutex); mma9551_set_device_state(data->client, false); mutex_unlock(&data->mutex); - - return 0; } static int mma9553_runtime_suspend(struct device *dev) diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c index ceca28913355..7b1d6fb692b3 100644 --- a/drivers/iio/accel/stk8312.c +++ b/drivers/iio/accel/stk8312.c @@ -597,7 +597,7 @@ err_power_off: return ret; } -static int stk8312_remove(struct i2c_client *client) +static void stk8312_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct stk8312_data *data = iio_priv(indio_dev); @@ -609,8 +609,6 @@ static int stk8312_remove(struct i2c_client *client) iio_trigger_unregister(data->dready_trig); stk8312_set_mode(data, STK8312_MODE_STANDBY); - - return 0; } static int stk8312_suspend(struct device *dev) diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c index 7d59efb41e22..2f5e4ab2a6e7 100644 --- a/drivers/iio/accel/stk8ba50.c +++ b/drivers/iio/accel/stk8ba50.c @@ -490,7 +490,7 @@ err_power_off: return ret; } -static int stk8ba50_remove(struct i2c_client *client) +static void stk8ba50_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct stk8ba50_data *data = iio_priv(indio_dev); @@ -502,8 +502,6 @@ static int stk8ba50_remove(struct i2c_client *client) iio_trigger_unregister(data->dready_trig); stk8ba50_set_power(data, STK8BA50_MODE_SUSPEND); - - return 0; } static int stk8ba50_suspend(struct device *dev) diff --git a/drivers/iio/adc/ad7292.c b/drivers/iio/adc/ad7292.c index 92c68d467c50..a2f9fda25ff3 100644 --- a/drivers/iio/adc/ad7292.c +++ b/drivers/iio/adc/ad7292.c @@ -287,10 +287,8 @@ static int ad7292_probe(struct spi_device *spi) ret = devm_add_action_or_reset(&spi->dev, ad7292_regulator_disable, st); - if (ret) { - regulator_disable(st->reg); + if (ret) return ret; - } ret = regulator_get_voltage(st->reg); if (ret < 0) diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c index 262bd7665b33..6dbe9d5e08a2 100644 --- a/drivers/iio/adc/ad799x.c +++ b/drivers/iio/adc/ad799x.c @@ -880,7 +880,7 @@ error_disable_reg: return ret; } -static int ad799x_remove(struct i2c_client *client) +static void ad799x_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ad799x_state *st = iio_priv(indio_dev); @@ -892,8 +892,6 @@ static int ad799x_remove(struct i2c_client *client) regulator_disable(st->vref); regulator_disable(st->reg); kfree(st->rx_buf); - - return 0; } static int ad799x_suspend(struct device *dev) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index 240e6c420701..910e7e965fc4 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -1034,7 +1034,7 @@ static int ina2xx_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int ina2xx_remove(struct i2c_client *client) +static void ina2xx_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ina2xx_chip_info *chip = iio_priv(indio_dev); @@ -1048,8 +1048,6 @@ static int ina2xx_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to power down device (%pe)\n", ERR_PTR(ret)); - - return 0; } static const struct i2c_device_id ina2xx_id[] = { diff --git a/drivers/iio/adc/ltc2497.c b/drivers/iio/adc/ltc2497.c index f7c786f37ceb..d58a432bafe1 100644 --- a/drivers/iio/adc/ltc2497.c +++ b/drivers/iio/adc/ltc2497.c @@ -74,13 +74,11 @@ static int ltc2497_probe(struct i2c_client *client, return ltc2497core_probe(dev, indio_dev); } -static int ltc2497_remove(struct i2c_client *client) +static void ltc2497_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); ltc2497core_remove(indio_dev); - - return 0; } static const struct i2c_device_id ltc2497_id[] = { diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c index 1cb4590fe412..890af7dca62d 100644 --- a/drivers/iio/adc/mcp3911.c +++ b/drivers/iio/adc/mcp3911.c @@ -40,8 +40,8 @@ #define MCP3911_CHANNEL(x) (MCP3911_REG_CHANNEL0 + x * 3) #define MCP3911_OFFCAL(x) (MCP3911_REG_OFFCAL_CH0 + x * 6) -/* Internal voltage reference in uV */ -#define MCP3911_INT_VREF_UV 1200000 +/* Internal voltage reference in mV */ +#define MCP3911_INT_VREF_MV 1200 #define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 5) | (1 << 0)) & 0xff) #define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 5) | (0 << 0)) & 0xff) @@ -113,6 +113,8 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev, if (ret) goto out; + *val = sign_extend32(*val, 23); + ret = IIO_VAL_INT; break; @@ -137,11 +139,18 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev, *val = ret / 1000; } else { - *val = MCP3911_INT_VREF_UV; + *val = MCP3911_INT_VREF_MV; } - *val2 = 24; - ret = IIO_VAL_FRACTIONAL_LOG2; + /* + * For 24bit Conversion + * Raw = ((Voltage)/(Vref) * 2^23 * Gain * 1.5 + * Voltage = Raw * (Vref)/(2^23 * Gain * 1.5) + */ + + /* val2 = (2^23 * 1.5) */ + *val2 = 12582912; + ret = IIO_VAL_FRACTIONAL; break; } @@ -208,7 +217,14 @@ static int mcp3911_config(struct mcp3911 *adc) u32 configreg; int ret; - device_property_read_u32(dev, "device-addr", &adc->dev_addr); + ret = device_property_read_u32(dev, "microchip,device-addr", &adc->dev_addr); + + /* + * Fallback to "device-addr" due to historical mismatch between + * dt-bindings and implementation + */ + if (ret) + device_property_read_u32(dev, "device-addr", &adc->dev_addr); if (adc->dev_addr > 3) { dev_err(&adc->spi->dev, "invalid device address (%i). Must be in range 0-3.\n", diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 2d393a4dfff6..a6ade70dedf8 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -412,9 +412,9 @@ static int sun4i_gpadc_runtime_resume(struct device *dev) return 0; } -static int sun4i_gpadc_get_temp(void *data, int *temp) +static int sun4i_gpadc_get_temp(struct thermal_zone_device *tz, int *temp) { - struct sun4i_gpadc_iio *info = data; + struct sun4i_gpadc_iio *info = tz->devdata; int val, scale, offset; if (sun4i_gpadc_temp_read(info->indio_dev, &val)) @@ -428,7 +428,7 @@ static int sun4i_gpadc_get_temp(void *data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops sun4i_ts_tz_ops = { +static const struct thermal_zone_device_ops sun4i_ts_tz_ops = { .get_temp = &sun4i_gpadc_get_temp, }; @@ -637,9 +637,9 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); if (IS_ENABLED(CONFIG_THERMAL_OF)) { - info->tzd = thermal_zone_of_sensor_register(info->sensor_device, - 0, info, - &sun4i_ts_tz_ops); + info->tzd = devm_thermal_of_zone_register(info->sensor_device, + 0, info, + &sun4i_ts_tz_ops); /* * Do not fail driver probing when failing to register in * thermal because no thermal DT node is found. @@ -681,8 +681,6 @@ static int sun4i_gpadc_remove(struct platform_device *pdev) if (!IS_ENABLED(CONFIG_THERMAL_OF)) return 0; - thermal_zone_of_sensor_unregister(info->sensor_device, info->tzd); - if (!info->no_irq) iio_map_array_unregister(indio_dev); diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c index e3dfc155fbe2..8bceba694026 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c @@ -1094,7 +1094,7 @@ static int ads1015_probe(struct i2c_client *client, return 0; } -static int ads1015_remove(struct i2c_client *client) +static void ads1015_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ads1015_data *data = iio_priv(indio_dev); @@ -1110,8 +1110,6 @@ static int ads1015_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to power down (%pe)\n", ERR_PTR(ret)); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c index 8378c00fa2ff..7cac77a931c7 100644 --- a/drivers/iio/chemical/atlas-sensor.c +++ b/drivers/iio/chemical/atlas-sensor.c @@ -722,7 +722,7 @@ unregister_trigger: return ret; } -static int atlas_remove(struct i2c_client *client) +static void atlas_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct atlas_data *data = iio_priv(indio_dev); @@ -739,8 +739,6 @@ static int atlas_remove(struct i2c_client *client) if (ret) dev_err(&client->dev, "Failed to power down device (%pe)\n", ERR_PTR(ret)); - - return 0; } static int atlas_runtime_suspend(struct device *dev) diff --git a/drivers/iio/chemical/ccs811.c b/drivers/iio/chemical/ccs811.c index 560183efb36f..ba4045e20303 100644 --- a/drivers/iio/chemical/ccs811.c +++ b/drivers/iio/chemical/ccs811.c @@ -532,7 +532,7 @@ err_poweroff: return ret; } -static int ccs811_remove(struct i2c_client *client) +static void ccs811_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ccs811_data *data = iio_priv(indio_dev); @@ -548,8 +548,6 @@ static int ccs811_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to power down device (%pe)\n", ERR_PTR(ret)); - - return 0; } static const struct i2c_device_id ccs811_id[] = { diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c index 2343d444604d..e2c13c78c7e0 100644 --- a/drivers/iio/chemical/sgp30.c +++ b/drivers/iio/chemical/sgp30.c @@ -552,15 +552,13 @@ static int sgp_probe(struct i2c_client *client, return 0; } -static int sgp_remove(struct i2c_client *client) +static void sgp_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct sgp_data *data = iio_priv(indio_dev); if (data->iaq_thread) kthread_stop(data->iaq_thread); - - return 0; } static const struct i2c_device_id sgp_id[] = { diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c index 81775152aac6..a81bfa47a221 100644 --- a/drivers/iio/dac/ad5380.c +++ b/drivers/iio/dac/ad5380.c @@ -559,11 +559,9 @@ static int ad5380_i2c_probe(struct i2c_client *i2c, return ad5380_probe(&i2c->dev, regmap, id->driver_data, id->name); } -static int ad5380_i2c_remove(struct i2c_client *i2c) +static void ad5380_i2c_remove(struct i2c_client *i2c) { ad5380_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5380_i2c_ids[] = { diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c index 09e242949cd0..7324065d3782 100644 --- a/drivers/iio/dac/ad5446.c +++ b/drivers/iio/dac/ad5446.c @@ -575,11 +575,9 @@ static int ad5446_i2c_probe(struct i2c_client *i2c, &ad5446_i2c_chip_info[id->driver_data]); } -static int ad5446_i2c_remove(struct i2c_client *i2c) +static void ad5446_i2c_remove(struct i2c_client *i2c) { ad5446_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5446_i2c_ids[] = { diff --git a/drivers/iio/dac/ad5593r.c b/drivers/iio/dac/ad5593r.c index 34e1319a9712..92be661034a6 100644 --- a/drivers/iio/dac/ad5593r.c +++ b/drivers/iio/dac/ad5593r.c @@ -97,11 +97,9 @@ static int ad5593r_i2c_probe(struct i2c_client *i2c, return ad5592r_probe(&i2c->dev, id->name, &ad5593r_rw_ops); } -static int ad5593r_i2c_remove(struct i2c_client *i2c) +static void ad5593r_i2c_remove(struct i2c_client *i2c) { ad5592r_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5593r_i2c_ids[] = { diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c index 762503c1901b..aa36cbf0137c 100644 --- a/drivers/iio/dac/ad5696-i2c.c +++ b/drivers/iio/dac/ad5696-i2c.c @@ -65,11 +65,9 @@ static int ad5686_i2c_probe(struct i2c_client *i2c, ad5686_i2c_write, ad5686_i2c_read); } -static int ad5686_i2c_remove(struct i2c_client *i2c) +static void ad5686_i2c_remove(struct i2c_client *i2c) { ad5686_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id ad5686_i2c_id[] = { diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c index 509394690bcc..3e17a681174e 100644 --- a/drivers/iio/dac/ds4424.c +++ b/drivers/iio/dac/ds4424.c @@ -281,15 +281,13 @@ fail: return ret; } -static int ds4424_remove(struct i2c_client *client) +static void ds4424_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ds4424_data *data = iio_priv(indio_dev); iio_device_unregister(indio_dev); regulator_disable(data->vcc_reg); - - return 0; } static const struct i2c_device_id ds4424_id[] = { diff --git a/drivers/iio/dac/m62332.c b/drivers/iio/dac/m62332.c index 22b02f50fe41..5a812f87970c 100644 --- a/drivers/iio/dac/m62332.c +++ b/drivers/iio/dac/m62332.c @@ -218,7 +218,7 @@ err: return ret; } -static int m62332_remove(struct i2c_client *client) +static void m62332_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -226,8 +226,6 @@ static int m62332_remove(struct i2c_client *client) iio_map_array_unregister(indio_dev); m62332_set_value(indio_dev, 0, 0); m62332_set_value(indio_dev, 0, 1); - - return 0; } static const struct i2c_device_id m62332_id[] = { diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index bb4b85a7b95b..446d1a8fe4be 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c @@ -486,7 +486,7 @@ err_disable_vdd_reg: return err; } -static int mcp4725_remove(struct i2c_client *client) +static void mcp4725_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mcp4725_data *data = iio_priv(indio_dev); @@ -496,8 +496,6 @@ static int mcp4725_remove(struct i2c_client *client) if (data->vref_reg) regulator_disable(data->vref_reg); regulator_disable(data->vdd_reg); - - return 0; } static const struct i2c_device_id mcp4725_id[] = { diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c index f91f8a504989..3210e3098f9a 100644 --- a/drivers/iio/dac/ti-dac5571.c +++ b/drivers/iio/dac/ti-dac5571.c @@ -382,15 +382,13 @@ static int dac5571_probe(struct i2c_client *client, return ret; } -static int dac5571_remove(struct i2c_client *i2c) +static void dac5571_remove(struct i2c_client *i2c) { struct iio_dev *indio_dev = i2c_get_clientdata(i2c); struct dac5571_data *data = iio_priv(indio_dev); iio_device_unregister(indio_dev); regulator_disable(data->vref); - - return 0; } static const struct of_device_id dac5571_of_id[] = { diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c index b3fa46bd02cb..908ccc385254 100644 --- a/drivers/iio/gyro/bmg160_i2c.c +++ b/drivers/iio/gyro/bmg160_i2c.c @@ -32,11 +32,9 @@ static int bmg160_i2c_probe(struct i2c_client *client, return bmg160_core_probe(&client->dev, regmap, client->irq, name); } -static int bmg160_i2c_remove(struct i2c_client *client) +static void bmg160_i2c_remove(struct i2c_client *client) { bmg160_core_remove(&client->dev); - - return 0; } static const struct acpi_device_id bmg160_acpi_match[] = { diff --git a/drivers/iio/gyro/fxas21002c_i2c.c b/drivers/iio/gyro/fxas21002c_i2c.c index a7807fd97483..13bb52c594d1 100644 --- a/drivers/iio/gyro/fxas21002c_i2c.c +++ b/drivers/iio/gyro/fxas21002c_i2c.c @@ -33,11 +33,9 @@ static int fxas21002c_i2c_probe(struct i2c_client *i2c) return fxas21002c_core_probe(&i2c->dev, regmap, i2c->irq, i2c->name); } -static int fxas21002c_i2c_remove(struct i2c_client *i2c) +static void fxas21002c_i2c_remove(struct i2c_client *i2c) { fxas21002c_core_remove(&i2c->dev); - - return 0; } static const struct i2c_device_id fxas21002c_i2c_id[] = { diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c index 0491c64e1b32..421501584587 100644 --- a/drivers/iio/gyro/itg3200_core.c +++ b/drivers/iio/gyro/itg3200_core.c @@ -350,7 +350,7 @@ error_unconfigure_buffer: return ret; } -static int itg3200_remove(struct i2c_client *client) +static void itg3200_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -360,8 +360,6 @@ static int itg3200_remove(struct i2c_client *client) itg3200_remove_trigger(indio_dev); itg3200_buffer_unconfigure(indio_dev); - - return 0; } static int itg3200_suspend(struct device *dev) diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c index 78f4a0102986..12e3afa9dd11 100644 --- a/drivers/iio/gyro/mpu3050-i2c.c +++ b/drivers/iio/gyro/mpu3050-i2c.c @@ -78,7 +78,7 @@ static int mpu3050_i2c_probe(struct i2c_client *client, return 0; } -static int mpu3050_i2c_remove(struct i2c_client *client) +static void mpu3050_i2c_remove(struct i2c_client *client) { struct iio_dev *indio_dev = dev_get_drvdata(&client->dev); struct mpu3050 *mpu3050 = iio_priv(indio_dev); @@ -87,8 +87,6 @@ static int mpu3050_i2c_remove(struct i2c_client *client) i2c_mux_del_adapters(mpu3050->i2cmux); mpu3050_common_remove(&client->dev); - - return 0; } /* diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c index dd7800159051..8fca787b2524 100644 --- a/drivers/iio/health/afe4404.c +++ b/drivers/iio/health/afe4404.c @@ -578,7 +578,7 @@ disable_reg: return ret; } -static int afe4404_remove(struct i2c_client *client) +static void afe4404_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct afe4404_data *afe = iio_priv(indio_dev); @@ -594,8 +594,6 @@ static int afe4404_remove(struct i2c_client *client) ret = regulator_disable(afe->regulator); if (ret) dev_err(afe->dev, "Unable to disable regulator\n"); - - return 0; } static const struct i2c_device_id afe4404_ids[] = { diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c index ad5717965223..2cca5e0519f8 100644 --- a/drivers/iio/health/max30100.c +++ b/drivers/iio/health/max30100.c @@ -471,15 +471,13 @@ static int max30100_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int max30100_remove(struct i2c_client *client) +static void max30100_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct max30100_data *data = iio_priv(indio_dev); iio_device_unregister(indio_dev); max30100_set_powermode(data, false); - - return 0; } static const struct i2c_device_id max30100_id[] = { diff --git a/drivers/iio/health/max30102.c b/drivers/iio/health/max30102.c index abbcef563807..437298a29f2d 100644 --- a/drivers/iio/health/max30102.c +++ b/drivers/iio/health/max30102.c @@ -592,15 +592,13 @@ static int max30102_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int max30102_remove(struct i2c_client *client) +static void max30102_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct max30102_data *data = iio_priv(indio_dev); iio_device_unregister(indio_dev); max30102_set_power(data, false); - - return 0; } static const struct i2c_device_id max30102_id[] = { diff --git a/drivers/iio/humidity/hdc2010.c b/drivers/iio/humidity/hdc2010.c index 1381df46187c..d6858ccb056e 100644 --- a/drivers/iio/humidity/hdc2010.c +++ b/drivers/iio/humidity/hdc2010.c @@ -308,7 +308,7 @@ static int hdc2010_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int hdc2010_remove(struct i2c_client *client) +static void hdc2010_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct hdc2010_data *data = iio_priv(indio_dev); @@ -318,8 +318,6 @@ static int hdc2010_remove(struct i2c_client *client) /* Disable Automatic Measurement Mode */ if (hdc2010_update_drdy_config(data, HDC2010_AMM, 0)) dev_warn(&client->dev, "Unable to restore default AMM\n"); - - return 0; } static const struct i2c_device_id hdc2010_id[] = { diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index 2aa647704a79..14255a918eb1 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -157,7 +157,7 @@ out_del_mux: return result; } -static int inv_mpu_remove(struct i2c_client *client) +static void inv_mpu_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct inv_mpu6050_state *st = iio_priv(indio_dev); @@ -166,8 +166,6 @@ static int inv_mpu_remove(struct i2c_client *client) inv_mpu_acpi_delete_mux_client(client); i2c_mux_del_adapters(st->muxc); } - - return 0; } /* diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c index ec23b1ee472b..b10c0dcac0bb 100644 --- a/drivers/iio/imu/kmx61.c +++ b/drivers/iio/imu/kmx61.c @@ -1418,7 +1418,7 @@ err_chip_uninit: return ret; } -static int kmx61_remove(struct i2c_client *client) +static void kmx61_remove(struct i2c_client *client) { struct kmx61_data *data = i2c_get_clientdata(client); @@ -1439,8 +1439,6 @@ static int kmx61_remove(struct i2c_client *client) mutex_lock(&data->lock); kmx61_set_mode(data, KMX61_ALL_STBY, KMX61_ACC | KMX61_MAG, true); mutex_unlock(&data->lock); - - return 0; } static int kmx61_suspend(struct device *dev) diff --git a/drivers/iio/light/apds9300.c b/drivers/iio/light/apds9300.c index 0f9d77598997..b70f2681bcb3 100644 --- a/drivers/iio/light/apds9300.c +++ b/drivers/iio/light/apds9300.c @@ -452,7 +452,7 @@ err: return ret; } -static int apds9300_remove(struct i2c_client *client) +static void apds9300_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct apds9300_data *data = iio_priv(indio_dev); @@ -462,8 +462,6 @@ static int apds9300_remove(struct i2c_client *client) /* Ensure that power off and interrupts are disabled */ apds9300_set_intr_state(data, 0); apds9300_set_power_state(data, 0); - - return 0; } static int apds9300_suspend(struct device *dev) diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c index 09b831f9f40b..b62c139baf41 100644 --- a/drivers/iio/light/apds9960.c +++ b/drivers/iio/light/apds9960.c @@ -1067,7 +1067,7 @@ error_power_down: return ret; } -static int apds9960_remove(struct i2c_client *client) +static void apds9960_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct apds9960_data *data = iio_priv(indio_dev); @@ -1076,8 +1076,6 @@ static int apds9960_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); apds9960_set_powermode(data, 0); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/iio/light/bh1750.c b/drivers/iio/light/bh1750.c index 471985c220bb..3e92820bc820 100644 --- a/drivers/iio/light/bh1750.c +++ b/drivers/iio/light/bh1750.c @@ -263,7 +263,7 @@ static int bh1750_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int bh1750_remove(struct i2c_client *client) +static void bh1750_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct bh1750_data *data = iio_priv(indio_dev); @@ -273,8 +273,6 @@ static int bh1750_remove(struct i2c_client *client) mutex_lock(&data->lock); i2c_smbus_write_byte(client, BH1750_POWER_DOWN); mutex_unlock(&data->lock); - - return 0; } static int bh1750_suspend(struct device *dev) diff --git a/drivers/iio/light/bh1780.c b/drivers/iio/light/bh1780.c index fc7141390117..90bca392b262 100644 --- a/drivers/iio/light/bh1780.c +++ b/drivers/iio/light/bh1780.c @@ -202,7 +202,7 @@ out_disable_pm: return ret; } -static int bh1780_remove(struct i2c_client *client) +static void bh1780_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct bh1780_data *bh1780 = iio_priv(indio_dev); @@ -216,8 +216,6 @@ static int bh1780_remove(struct i2c_client *client) if (ret < 0) dev_err(&client->dev, "failed to power off (%pe)\n", ERR_PTR(ret)); - - return 0; } static int bh1780_runtime_suspend(struct device *dev) diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c index edbe6a3138d0..001055d09750 100644 --- a/drivers/iio/light/cm32181.c +++ b/drivers/iio/light/cm32181.c @@ -505,7 +505,7 @@ static int cm32181_resume(struct device *dev) cm32181->conf_regs[CM32181_REG_ADDR_CMD]); } -DEFINE_SIMPLE_DEV_PM_OPS(cm32181_pm_ops, cm32181_suspend, cm32181_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cm32181_pm_ops, cm32181_suspend, cm32181_resume); static const struct of_device_id cm32181_of_match[] = { { .compatible = "capella,cm3218" }, diff --git a/drivers/iio/light/cm3232.c b/drivers/iio/light/cm3232.c index 2c80a0535d2c..5214cd014cf8 100644 --- a/drivers/iio/light/cm3232.c +++ b/drivers/iio/light/cm3232.c @@ -357,7 +357,7 @@ static int cm3232_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int cm3232_remove(struct i2c_client *client) +static void cm3232_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -365,8 +365,6 @@ static int cm3232_remove(struct i2c_client *client) CM3232_CMD_ALS_DISABLE); iio_device_unregister(indio_dev); - - return 0; } static const struct i2c_device_id cm3232_id[] = { diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c index c721b69d5095..0b30db77f78b 100644 --- a/drivers/iio/light/cm3605.c +++ b/drivers/iio/light/cm3605.c @@ -226,8 +226,10 @@ static int cm3605_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (irq < 0) - return dev_err_probe(dev, irq, "failed to get irq\n"); + if (irq < 0) { + ret = dev_err_probe(dev, irq, "failed to get irq\n"); + goto out_disable_aset; + } ret = devm_request_threaded_irq(dev, irq, cm3605_prox_irq, NULL, 0, "cm3605", indio_dev); diff --git a/drivers/iio/light/cm36651.c b/drivers/iio/light/cm36651.c index 89f5e48a6642..6615c98b601c 100644 --- a/drivers/iio/light/cm36651.c +++ b/drivers/iio/light/cm36651.c @@ -700,7 +700,7 @@ error_disable_reg: return ret; } -static int cm36651_remove(struct i2c_client *client) +static void cm36651_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct cm36651_data *cm36651 = iio_priv(indio_dev); @@ -710,8 +710,6 @@ static int cm36651_remove(struct i2c_client *client) free_irq(client->irq, indio_dev); i2c_unregister_device(cm36651->ps_client); i2c_unregister_device(cm36651->ara_client); - - return 0; } static const struct i2c_device_id cm36651_id[] = { diff --git a/drivers/iio/light/gp2ap002.c b/drivers/iio/light/gp2ap002.c index e2707416f9a8..8000fa347344 100644 --- a/drivers/iio/light/gp2ap002.c +++ b/drivers/iio/light/gp2ap002.c @@ -619,7 +619,7 @@ out_disable_vdd: return ret; } -static int gp2ap002_remove(struct i2c_client *client) +static void gp2ap002_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct gp2ap002 *gp2ap002 = iio_priv(indio_dev); @@ -631,8 +631,6 @@ static int gp2ap002_remove(struct i2c_client *client) iio_device_unregister(indio_dev); regulator_disable(gp2ap002->vio); regulator_disable(gp2ap002->vdd); - - return 0; } static int gp2ap002_runtime_suspend(struct device *dev) diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index b820041159f7..826439299e8b 100644 --- a/drivers/iio/light/gp2ap020a00f.c +++ b/drivers/iio/light/gp2ap020a00f.c @@ -1573,7 +1573,7 @@ error_regulator_disable: return err; } -static int gp2ap020a00f_remove(struct i2c_client *client) +static void gp2ap020a00f_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct gp2ap020a00f_data *data = iio_priv(indio_dev); @@ -1589,8 +1589,6 @@ static int gp2ap020a00f_remove(struct i2c_client *client) free_irq(client->irq, indio_dev); iio_triggered_buffer_cleanup(indio_dev); regulator_disable(data->vled_reg); - - return 0; } static const struct i2c_device_id gp2ap020a00f_id[] = { diff --git a/drivers/iio/light/isl29028.c b/drivers/iio/light/isl29028.c index ff5996d77818..32d58e18f26d 100644 --- a/drivers/iio/light/isl29028.c +++ b/drivers/iio/light/isl29028.c @@ -636,7 +636,7 @@ static int isl29028_probe(struct i2c_client *client, return 0; } -static int isl29028_remove(struct i2c_client *client) +static void isl29028_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct isl29028_chip *chip = iio_priv(indio_dev); @@ -647,8 +647,6 @@ static int isl29028_remove(struct i2c_client *client) pm_runtime_set_suspended(&client->dev); isl29028_clear_configure_reg(chip); - - return 0; } static int isl29028_suspend(struct device *dev) diff --git a/drivers/iio/light/isl29125.c b/drivers/iio/light/isl29125.c index eb68a52aab82..c199e63cce82 100644 --- a/drivers/iio/light/isl29125.c +++ b/drivers/iio/light/isl29125.c @@ -300,15 +300,13 @@ static int isl29125_powerdown(struct isl29125_data *data) (data->conf1 & ~ISL29125_MODE_MASK) | ISL29125_MODE_PD); } -static int isl29125_remove(struct i2c_client *client) +static void isl29125_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); iio_device_unregister(indio_dev); iio_triggered_buffer_cleanup(indio_dev); isl29125_powerdown(iio_priv(indio_dev)); - - return 0; } static int isl29125_suspend(struct device *dev) diff --git a/drivers/iio/light/jsa1212.c b/drivers/iio/light/jsa1212.c index 5387c12231cf..57ce6d75966c 100644 --- a/drivers/iio/light/jsa1212.c +++ b/drivers/iio/light/jsa1212.c @@ -373,7 +373,7 @@ static int jsa1212_power_off(struct jsa1212_data *data) return ret; } -static int jsa1212_remove(struct i2c_client *client) +static void jsa1212_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct jsa1212_data *data = iio_priv(indio_dev); @@ -381,8 +381,6 @@ static int jsa1212_remove(struct i2c_client *client) iio_device_unregister(indio_dev); jsa1212_power_off(data); - - return 0; } static int jsa1212_suspend(struct device *dev) diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 679a1e1086ae..74a1ccda8b9c 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1600,15 +1600,13 @@ powerdown_on_error: return ret; } -static int ltr501_remove(struct i2c_client *client) +static void ltr501_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); iio_device_unregister(indio_dev); iio_triggered_buffer_cleanup(indio_dev); ltr501_powerdown(iio_priv(indio_dev)); - - return 0; } static int ltr501_suspend(struct device *dev) diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c index a326d47afc9b..a26d1c3f9543 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -794,7 +794,7 @@ static int opt3001_probe(struct i2c_client *client, return 0; } -static int opt3001_remove(struct i2c_client *client) +static void opt3001_remove(struct i2c_client *client) { struct iio_dev *iio = i2c_get_clientdata(client); struct opt3001 *opt = iio_priv(iio); @@ -808,7 +808,7 @@ static int opt3001_remove(struct i2c_client *client) if (ret < 0) { dev_err(opt->dev, "failed to read register %02x\n", OPT3001_CONFIGURATION); - return 0; + return; } reg = ret; @@ -820,8 +820,6 @@ static int opt3001_remove(struct i2c_client *client) dev_err(opt->dev, "failed to write register %02x\n", OPT3001_CONFIGURATION); } - - return 0; } static const struct i2c_device_id opt3001_id[] = { diff --git a/drivers/iio/light/pa12203001.c b/drivers/iio/light/pa12203001.c index 772874e707ae..3cb2de51f4aa 100644 --- a/drivers/iio/light/pa12203001.c +++ b/drivers/iio/light/pa12203001.c @@ -394,7 +394,7 @@ out_err: return ret; } -static int pa12203001_remove(struct i2c_client *client) +static void pa12203001_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); int ret; @@ -408,8 +408,6 @@ static int pa12203001_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to power down (%pe)\n", ERR_PTR(ret)); - - return 0; } #if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM) diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c index dabdd05f0e2c..d1c16dd76058 100644 --- a/drivers/iio/light/rpr0521.c +++ b/drivers/iio/light/rpr0521.c @@ -1041,7 +1041,7 @@ err_poweroff: return ret; } -static int rpr0521_remove(struct i2c_client *client) +static void rpr0521_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -1051,8 +1051,6 @@ static int rpr0521_remove(struct i2c_client *client) pm_runtime_set_suspended(&client->dev); rpr0521_poweroff(iio_priv(indio_dev)); - - return 0; } static int rpr0521_runtime_suspend(struct device *dev) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index f7cc7a6c0c8d..7b8e0da6aabc 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -649,14 +649,12 @@ err_standby: return ret; } -static int stk3310_remove(struct i2c_client *client) +static void stk3310_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); iio_device_unregister(indio_dev); stk3310_set_state(iio_priv(indio_dev), STK3310_STATE_STANDBY); - - return 0; } static int stk3310_suspend(struct device *dev) diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index 823435f59bb6..db17fec634be 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c @@ -559,7 +559,7 @@ static int tcs3472_powerdown(struct tcs3472_data *data) return ret; } -static int tcs3472_remove(struct i2c_client *client) +static void tcs3472_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -568,8 +568,6 @@ static int tcs3472_remove(struct i2c_client *client) free_irq(client->irq, indio_dev); iio_triggered_buffer_cleanup(indio_dev); tcs3472_powerdown(iio_priv(indio_dev)); - - return 0; } static int tcs3472_suspend(struct device *dev) diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c index bbb577459fb9..951f35ef3f41 100644 --- a/drivers/iio/light/tsl2563.c +++ b/drivers/iio/light/tsl2563.c @@ -796,7 +796,7 @@ fail: return err; } -static int tsl2563_remove(struct i2c_client *client) +static void tsl2563_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct tsl2563_chip *chip = iio_priv(indio_dev); @@ -809,8 +809,6 @@ static int tsl2563_remove(struct i2c_client *client) i2c_smbus_write_byte_data(chip->client, TSL2563_CMD | TSL2563_REG_INT, chip->intr); tsl2563_set_power(chip, 0); - - return 0; } static int tsl2563_suspend(struct device *dev) diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c index 82662dab87c0..0a2ca1a8146d 100644 --- a/drivers/iio/light/tsl2583.c +++ b/drivers/iio/light/tsl2583.c @@ -873,7 +873,7 @@ static int tsl2583_probe(struct i2c_client *clientp, return 0; } -static int tsl2583_remove(struct i2c_client *client) +static void tsl2583_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct tsl2583_chip *chip = iio_priv(indio_dev); @@ -884,8 +884,6 @@ static int tsl2583_remove(struct i2c_client *client) pm_runtime_set_suspended(&client->dev); tsl2583_set_power_state(chip, TSL2583_CNTL_PWR_OFF); - - return 0; } static int tsl2583_suspend(struct device *dev) diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c index 6ae1b27e50b6..090038fed889 100644 --- a/drivers/iio/light/tsl4531.c +++ b/drivers/iio/light/tsl4531.c @@ -207,12 +207,10 @@ static int tsl4531_powerdown(struct i2c_client *client) TSL4531_MODE_POWERDOWN); } -static int tsl4531_remove(struct i2c_client *client) +static void tsl4531_remove(struct i2c_client *client) { iio_device_unregister(i2c_get_clientdata(client)); tsl4531_powerdown(client); - - return 0; } static int tsl4531_suspend(struct device *dev) diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c index 80d2299da561..3e652d7f3b0e 100644 --- a/drivers/iio/light/us5182d.c +++ b/drivers/iio/light/us5182d.c @@ -904,7 +904,7 @@ out_err: } -static int us5182d_remove(struct i2c_client *client) +static void us5182d_remove(struct i2c_client *client) { struct us5182d_data *data = iio_priv(i2c_get_clientdata(client)); int ret; @@ -918,8 +918,6 @@ static int us5182d_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to shut down (%pe)\n", ERR_PTR(ret)); - - return 0; } static int us5182d_suspend(struct device *dev) diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index 3db4e26731bb..f6c83ecaad8b 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -1111,7 +1111,7 @@ static const struct of_device_id vcnl_4000_of_match[] = { }; MODULE_DEVICE_TABLE(of, vcnl_4000_of_match); -static int vcnl4000_remove(struct i2c_client *client) +static void vcnl4000_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct vcnl4000_data *data = iio_priv(indio_dev); @@ -1126,8 +1126,6 @@ static int vcnl4000_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to power down (%pe)\n", ERR_PTR(ret)); - - return 0; } static int vcnl4000_runtime_suspend(struct device *dev) diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c index 6a196cf2270b..3ed37f6057fb 100644 --- a/drivers/iio/light/vcnl4035.c +++ b/drivers/iio/light/vcnl4035.c @@ -601,7 +601,7 @@ fail_poweroff: return ret; } -static int vcnl4035_remove(struct i2c_client *client) +static void vcnl4035_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); int ret; @@ -616,8 +616,6 @@ static int vcnl4035_remove(struct i2c_client *client) if (ret) dev_warn(&client->dev, "Failed to put device into standby (%pe)\n", ERR_PTR(ret)); - - return 0; } static int vcnl4035_runtime_suspend(struct device *dev) diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c index 1e55e09a8d16..cfa4e9e7c803 100644 --- a/drivers/iio/light/veml6070.c +++ b/drivers/iio/light/veml6070.c @@ -180,15 +180,13 @@ fail: return ret; } -static int veml6070_remove(struct i2c_client *client) +static void veml6070_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct veml6070_data *data = iio_priv(indio_dev); iio_device_unregister(indio_dev); i2c_unregister_device(data->client2); - - return 0; } static const struct i2c_device_id veml6070_id[] = { diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index c89a91db0690..7ec9ab3beb45 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -969,7 +969,7 @@ disable_pm: return ret; } -static int ak8974_remove(struct i2c_client *i2c) +static void ak8974_remove(struct i2c_client *i2c) { struct iio_dev *indio_dev = i2c_get_clientdata(i2c); struct ak8974 *ak8974 = iio_priv(indio_dev); @@ -981,8 +981,6 @@ static int ak8974_remove(struct i2c_client *i2c) pm_runtime_disable(&i2c->dev); ak8974_set_power(ak8974, AK8974_PWR_OFF); regulator_bulk_disable(ARRAY_SIZE(ak8974->regs), ak8974->regs); - - return 0; } static int ak8974_runtime_suspend(struct device *dev) diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 2432e697150c..caf03a2a98a5 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -1018,7 +1018,7 @@ power_off: return err; } -static int ak8975_remove(struct i2c_client *client) +static void ak8975_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct ak8975_data *data = iio_priv(indio_dev); @@ -1030,8 +1030,6 @@ static int ak8975_remove(struct i2c_client *client) iio_triggered_buffer_cleanup(indio_dev); ak8975_set_mode(data, POWER_DOWN); ak8975_power_off(data); - - return 0; } static int ak8975_runtime_suspend(struct device *dev) diff --git a/drivers/iio/magnetometer/bmc150_magn_i2c.c b/drivers/iio/magnetometer/bmc150_magn_i2c.c index 65c004411d0f..570deaa87836 100644 --- a/drivers/iio/magnetometer/bmc150_magn_i2c.c +++ b/drivers/iio/magnetometer/bmc150_magn_i2c.c @@ -34,11 +34,9 @@ static int bmc150_magn_i2c_probe(struct i2c_client *client, return bmc150_magn_probe(&client->dev, regmap, client->irq, name); } -static int bmc150_magn_i2c_remove(struct i2c_client *client) +static void bmc150_magn_i2c_remove(struct i2c_client *client) { bmc150_magn_remove(&client->dev); - - return 0; } static const struct acpi_device_id bmc150_magn_acpi_match[] = { diff --git a/drivers/iio/magnetometer/hmc5843_i2c.c b/drivers/iio/magnetometer/hmc5843_i2c.c index 8d2ff8fc204d..fe5e8415b2f2 100644 --- a/drivers/iio/magnetometer/hmc5843_i2c.c +++ b/drivers/iio/magnetometer/hmc5843_i2c.c @@ -65,11 +65,9 @@ static int hmc5843_i2c_probe(struct i2c_client *cli, id->driver_data, id->name); } -static int hmc5843_i2c_remove(struct i2c_client *client) +static void hmc5843_i2c_remove(struct i2c_client *client) { hmc5843_common_remove(&client->dev); - - return 0; } static const struct i2c_device_id hmc5843_id[] = { diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c index 226439d0bfb5..b870ad803862 100644 --- a/drivers/iio/magnetometer/mag3110.c +++ b/drivers/iio/magnetometer/mag3110.c @@ -559,7 +559,7 @@ disable_regulator_vdd: return ret; } -static int mag3110_remove(struct i2c_client *client) +static void mag3110_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mag3110_data *data = iio_priv(indio_dev); @@ -569,8 +569,6 @@ static int mag3110_remove(struct i2c_client *client) mag3110_standby(iio_priv(indio_dev)); regulator_disable(data->vddio_reg); regulator_disable(data->vdd_reg); - - return 0; } static int mag3110_suspend(struct device *dev) diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c index aeaa4da6923b..c3a10942654e 100644 --- a/drivers/iio/magnetometer/yamaha-yas530.c +++ b/drivers/iio/magnetometer/yamaha-yas530.c @@ -943,7 +943,7 @@ reg_off: return ret; } -static int yas5xx_remove(struct i2c_client *i2c) +static void yas5xx_remove(struct i2c_client *i2c) { struct iio_dev *indio_dev = i2c_get_clientdata(i2c); struct yas5xx *yas5xx = iio_priv(indio_dev); @@ -961,8 +961,6 @@ static int yas5xx_remove(struct i2c_client *i2c) pm_runtime_disable(dev); gpiod_set_value_cansleep(yas5xx->reset, 1); regulator_bulk_disable(ARRAY_SIZE(yas5xx->regs), yas5xx->regs); - - return 0; } static int yas5xx_runtime_suspend(struct device *dev) diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c index fe514f0b5506..5ec7060d31d9 100644 --- a/drivers/iio/potentiostat/lmp91000.c +++ b/drivers/iio/potentiostat/lmp91000.c @@ -384,7 +384,7 @@ error_unreg_trigger: return ret; } -static int lmp91000_remove(struct i2c_client *client) +static void lmp91000_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct lmp91000_data *data = iio_priv(indio_dev); @@ -396,8 +396,6 @@ static int lmp91000_remove(struct i2c_client *client) iio_triggered_buffer_cleanup(indio_dev); iio_trigger_unregister(data->trig); - - return 0; } static const struct of_device_id lmp91000_of_match[] = { diff --git a/drivers/iio/pressure/mpl3115.c b/drivers/iio/pressure/mpl3115.c index d4f89e4babed..2f22aba61e4d 100644 --- a/drivers/iio/pressure/mpl3115.c +++ b/drivers/iio/pressure/mpl3115.c @@ -290,15 +290,13 @@ static int mpl3115_standby(struct mpl3115_data *data) data->ctrl_reg1 & ~MPL3115_CTRL_ACTIVE); } -static int mpl3115_remove(struct i2c_client *client) +static void mpl3115_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); iio_device_unregister(indio_dev); iio_triggered_buffer_cleanup(indio_dev); mpl3115_standby(iio_priv(indio_dev)); - - return 0; } static int mpl3115_suspend(struct device *dev) diff --git a/drivers/iio/pressure/ms5611_i2c.c b/drivers/iio/pressure/ms5611_i2c.c index 3b1de71e0d15..b681a4183909 100644 --- a/drivers/iio/pressure/ms5611_i2c.c +++ b/drivers/iio/pressure/ms5611_i2c.c @@ -105,11 +105,9 @@ static int ms5611_i2c_probe(struct i2c_client *client, return ms5611_probe(indio_dev, &client->dev, id->name, id->driver_data); } -static int ms5611_i2c_remove(struct i2c_client *client) +static void ms5611_i2c_remove(struct i2c_client *client) { ms5611_remove(i2c_get_clientdata(client)); - - return 0; } static const struct of_device_id ms5611_i2c_matches[] = { diff --git a/drivers/iio/pressure/zpa2326_i2c.c b/drivers/iio/pressure/zpa2326_i2c.c index 0db0860d386b..f26dd8cbb387 100644 --- a/drivers/iio/pressure/zpa2326_i2c.c +++ b/drivers/iio/pressure/zpa2326_i2c.c @@ -53,11 +53,9 @@ static int zpa2326_probe_i2c(struct i2c_client *client, zpa2326_i2c_hwid(client), regmap); } -static int zpa2326_remove_i2c(struct i2c_client *client) +static void zpa2326_remove_i2c(struct i2c_client *client) { zpa2326_remove(&client->dev); - - return 0; } static const struct i2c_device_id zpa2326_i2c_ids[] = { diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index 648ae576d6fa..791a33d5286c 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -311,7 +311,7 @@ error_unreg_buffer: return ret; } -static int lidar_remove(struct i2c_client *client) +static void lidar_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -320,8 +320,6 @@ static int lidar_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); - - return 0; } static const struct i2c_device_id lidar_id[] = { diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index 42589d6200ad..d4670864ddc7 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -979,7 +979,7 @@ out_trigger_unregister: return ret; } -static int sx9500_remove(struct i2c_client *client) +static void sx9500_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct sx9500_data *data = iio_priv(indio_dev); @@ -989,8 +989,6 @@ static int sx9500_remove(struct i2c_client *client) if (client->irq > 0) iio_trigger_unregister(data->trig); kfree(data->buffer); - - return 0; } static int sx9500_suspend(struct device *dev) diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c index c253a5315988..0808bb865928 100644 --- a/drivers/iio/temperature/mlx90614.c +++ b/drivers/iio/temperature/mlx90614.c @@ -571,7 +571,7 @@ static int mlx90614_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int mlx90614_remove(struct i2c_client *client) +static void mlx90614_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mlx90614_data *data = iio_priv(indio_dev); @@ -584,8 +584,6 @@ static int mlx90614_remove(struct i2c_client *client) mlx90614_sleep(data); pm_runtime_set_suspended(&client->dev); } - - return 0; } static const struct i2c_device_id mlx90614_id[] = { diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index 7ee7ff8047a4..e8ef47147e2b 100644 --- a/drivers/iio/temperature/mlx90632.c +++ b/drivers/iio/temperature/mlx90632.c @@ -924,7 +924,7 @@ static int mlx90632_probe(struct i2c_client *client, return iio_device_register(indio_dev); } -static int mlx90632_remove(struct i2c_client *client) +static void mlx90632_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); struct mlx90632_data *data = iio_priv(indio_dev); @@ -936,8 +936,6 @@ static int mlx90632_remove(struct i2c_client *client) pm_runtime_put_noidle(&client->dev); mlx90632_sleep(data); - - return 0; } static const struct i2c_device_id mlx90632_id[] = { |