diff options
author | Nuno Sa <nuno.sa@analog.com> | 2024-06-06 09:22:39 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-06-30 13:27:33 +0200 |
commit | ac5189293acb85b3d6da4fc18c3374f0daf69594 (patch) | |
tree | 46e611c7d653800e33dd3aac6950267fa23c7fae /drivers/iio/industrialio-backend.c | |
parent | iio: temperature: ltc2983: convert to dev_err_probe() (diff) | |
download | linux-ac5189293acb85b3d6da4fc18c3374f0daf69594.tar.xz linux-ac5189293acb85b3d6da4fc18c3374f0daf69594.zip |
iio: backend: make use of dev_err_cast_probe()
Using dev_err_cast_probe() to simplify the code.
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20240606-dev-add_dev_errp_probe-v3-3-51bb229edd79@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/industrialio-backend.c')
-rw-r--r-- | drivers/iio/industrialio-backend.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c index 929aff4040ed..efe05be284b6 100644 --- a/drivers/iio/industrialio-backend.c +++ b/drivers/iio/industrialio-backend.c @@ -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) { |