diff options
author | Marek BehĂșn <kabel@kernel.org> | 2024-08-31 11:20:44 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2024-09-02 09:42:10 +0000 |
commit | 869b1fc0435699aec568101c1b4279d5bc03bf3c (patch) | |
tree | e38e34d57d5d09e74b642301144d0f4a9027ff2e /drivers/firmware | |
parent | fbd48bd8cf0c4063465e2713bfaedfa71709a116 (diff) |
firmware: turris-mox-rwtm: Use dev_err_probe() where possible
Use dev_err_probe() where possible in the driver's .probe() method.
Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240831092050.23093-11-kabel@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/turris-mox-rwtm.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index dd0dbaa9de72..f291df9a72ff 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -459,13 +459,9 @@ static int turris_mox_rwtm_probe(struct platform_device *pdev) rwtm->mbox_client.rx_callback = mox_rwtm_rx_callback; rwtm->mbox = mbox_request_channel(&rwtm->mbox_client, 0); - if (IS_ERR(rwtm->mbox)) { - ret = PTR_ERR(rwtm->mbox); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Cannot request mailbox channel: %i\n", - ret); - return ret; - } + if (IS_ERR(rwtm->mbox)) + return dev_err_probe(dev, PTR_ERR(rwtm->mbox), + "Cannot request mailbox channel!\n"); ret = devm_add_action_or_reset(dev, rwtm_devm_mbox_release, rwtm->mbox); if (ret) @@ -487,10 +483,8 @@ static int turris_mox_rwtm_probe(struct platform_device *pdev) rwtm->hwrng.priv = (unsigned long) rwtm; ret = devm_hwrng_register(dev, &rwtm->hwrng); - if (ret < 0) { - dev_err(dev, "Cannot register HWRNG: %i\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Cannot register HWRNG!\n"); rwtm_register_debugfs(rwtm); |