Commit ac518929 authored by Nuno Sa's avatar Nuno Sa Committed by Jonathan Cameron

iio: backend: make use of dev_err_cast_probe()

Using dev_err_cast_probe() to simplify the code.
Signed-off-by: default avatarNuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240606-dev-add_dev_errp_probe-v3-3-51bb229edd79@analog.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a00838ca
......@@ -561,11 +561,9 @@ struct iio_backend *devm_iio_backend_get(struct device *dev, const char *name)
}
fwnode = fwnode_find_reference(dev_fwnode(dev), "io-backends", index);
if (IS_ERR(fwnode)) {
dev_err_probe(dev, PTR_ERR(fwnode),
"Cannot get Firmware reference\n");
return ERR_CAST(fwnode);
}
if (IS_ERR(fwnode))
return dev_err_cast_probe(dev, fwnode,
"Cannot get Firmware reference\n");
guard(mutex)(&iio_back_lock);
list_for_each_entry(back, &iio_back_list, entry) {
......
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