Commit 9af7c980 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Hans Verkuil

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 12be815f
......@@ -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;
......
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