can: c_can: Simplify handling syscon error path

Use error handling block instead of open-coding it in one of probe
failure cases.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://patch.msgid.link/20250212-syscon-phandle-args-can-v2-2-ac9a1253396b@linaro.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Krzysztof Kozlowski 2025-02-12 21:23:13 +01:00 committed by Marc Kleine-Budde
parent fd2a0c47fb
commit 6c00b580d1

View File

@ -324,10 +324,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
raminit->syscon = syscon_regmap_lookup_by_phandle(np,
"syscon-raminit");
if (IS_ERR(raminit->syscon)) {
/* can fail with -EPROBE_DEFER */
ret = PTR_ERR(raminit->syscon);
free_c_can_dev(dev);
return ret;
goto exit_free_device;
}
if (of_property_read_u32_index(np, "syscon-raminit", 1,