diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-10-26 13:18:19 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-11-16 15:56:47 +0300 |
commit | 9af7c980f3ea3e85418beb25dc4d34939183e436 (patch) | |
tree | cb942a604a58d35946e93da4791e340925ed762b /drivers/media/rc/meson-ir-tx.c | |
parent | 12be815fbfd4c31aae4b23491b6dcf88a1e69299 (diff) | |
download | linux-9af7c980f3ea3e85418beb25dc4d34939183e436.tar.xz |
media: meson-ir-tx: Simplify and improve using dev_err_probe()
With dev_err_probe() the error paths can be implemented in a more
condensed way with the added benefit that the error code is added to the
error messages by name.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/rc/meson-ir-tx.c')
-rw-r--r-- | drivers/media/rc/meson-ir-tx.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c index dab548dc6302..bd85361d561f 100644 --- a/drivers/media/rc/meson-ir-tx.c +++ b/drivers/media/rc/meson-ir-tx.c @@ -333,20 +333,17 @@ static int __init meson_irtx_probe(struct platform_device *pdev) spin_lock_init(&ir->lock); ret = meson_irtx_mod_clock_probe(ir, &clk_nr); - if (ret) { - dev_err(dev, "modulator clock setup failed\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "modulator clock setup failed\n"); + meson_irtx_setup(ir, clk_nr); ret = devm_request_irq(dev, irq, meson_irtx_irqhandler, IRQF_TRIGGER_RISING, DRIVER_NAME, ir); - if (ret) { - dev_err(dev, "irq request failed\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "irq request failed\n"); rc = rc_allocate_device(RC_DRIVER_IR_RAW_TX); if (!rc) @@ -362,9 +359,8 @@ static int __init meson_irtx_probe(struct platform_device *pdev) ret = devm_rc_register_device(dev, rc); if (ret < 0) { - dev_err(dev, "rc_dev registration failed\n"); rc_free_device(rc); - return ret; + return dev_err_probe(dev, ret, "rc_dev registration failed\n"); } return 0; |