diff options
author | David Lechner <dlechner@baylibre.com> | 2024-05-06 18:59:16 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-05-07 04:31:48 +0300 |
commit | 346fe0ce1fd780038ca9e5bcb65aad54bae7c4d9 (patch) | |
tree | 44ac1309e5e72dfa3a2885b0a0680e4b5daa1132 /drivers/hwmon | |
parent | 257b2335eebf51e318db1f3b2d023512da46fa66 (diff) | |
download | linux-346fe0ce1fd780038ca9e5bcb65aad54bae7c4d9.tar.xz |
hwmon: (adc128d818) simplify final return in probe
The final return in adc128d818_probe() can be simplified by using
PTR_ERR_OR_ZERO rather than an if statement.
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David Lechner <dlechner@baylibre.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240506-regulator-devm_regulator_get_enable_read_voltage-fixes-v1-2-356cdd152067@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/adc128d818.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/adc128d818.c b/drivers/hwmon/adc128d818.c index 2a35acb011eb..321a61977396 100644 --- a/drivers/hwmon/adc128d818.c +++ b/drivers/hwmon/adc128d818.c @@ -475,10 +475,8 @@ static int adc128_probe(struct i2c_client *client) hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, data, adc128_groups); - if (IS_ERR(hwmon_dev)) - return PTR_ERR(hwmon_dev); - return 0; + return PTR_ERR_OR_ZERO(hwmon_dev); } static const struct i2c_device_id adc128_id[] = { |