Skip to content

Commit 346fe0c

Browse files
dlechbroonie
authored andcommitted
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 <[email protected]> Signed-off-by: David Lechner <[email protected]> Acked-by: Guenter Roeck <[email protected]> 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 <[email protected]>
1 parent 257b233 commit 346fe0c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/hwmon/adc128d818.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,8 @@ static int adc128_probe(struct i2c_client *client)
475475

476476
hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
477477
data, adc128_groups);
478-
if (IS_ERR(hwmon_dev))
479-
return PTR_ERR(hwmon_dev);
480478

481-
return 0;
479+
return PTR_ERR_OR_ZERO(hwmon_dev);
482480
}
483481

484482
static const struct i2c_device_id adc128_id[] = {

0 commit comments

Comments
 (0)