Commit 2a22b40a authored by Yuan Can's avatar Yuan Can Committed by Jonathan Cameron

iio: accel: bma400: Switch to use dev_err_probe() helper

In the probe path, dev_err() can be replace with dev_err_probe()
which will check if error code is -EPROBE_DEFER and prints the
error name.
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20220921023915.47300-1-yuancan@huawei.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 20228a1d
......@@ -886,14 +886,10 @@ static int bma400_init(struct bma400_data *data)
ret = devm_regulator_bulk_get(data->dev,
ARRAY_SIZE(data->regulators),
data->regulators);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(data->dev,
"Failed to get regulators: %d\n",
if (ret)
return dev_err_probe(data->dev, ret, "Failed to get regulators: %d\n",
ret);
return ret;
}
ret = regulator_bulk_enable(ARRAY_SIZE(data->regulators),
data->regulators);
if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment