[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240423-dev-add_dev_errp_probe-v2-3-12f43c5d8b0d@analog.com>
Date: Tue, 23 Apr 2024 17:20:32 +0200
From: Nuno Sa via B4 Relay <devnull+nuno.sa.analog.com@...nel.org>
To: Petr Mladek <pmladek@...e.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Chris Down <chris@...isdown.name>, John Ogness <john.ogness@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
Olivier Moysan <olivier.moysan@...s.st.com>,
Andi Shyti <andi.shyti@...nel.org>, Jyoti Bhayana <jbhayana@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
Nuno Sa <nuno.sa@...log.com>
Subject: [PATCH v2 3/4] iio: backend: make use of dev_err_cast_probe()
From: Nuno Sa <nuno.sa@...log.com>
Using dev_err_cast_probe() to simplify the code.
Signed-off-by: Nuno Sa <nuno.sa@...log.com>
---
drivers/iio/industrialio-backend.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/industrialio-backend.c b/drivers/iio/industrialio-backend.c
index f08ed6d70ae5..2cc6459246ce 100644
--- a/drivers/iio/industrialio-backend.c
+++ b/drivers/iio/industrialio-backend.c
@@ -475,11 +475,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) {
--
2.44.0
Powered by blists - more mailing lists