[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250112-syscon-phandle-args-can-v1-3-314d9549906f@linaro.org>
Date: Sun, 12 Jan 2025 13:41:54 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Marc Kleine-Budde <mkl@...gutronix.de>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
Tong Zhang <ztong0001@...il.com>
Cc: linux-can@...r.kernel.org, linux-kernel@...r.kernel.org,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Subject: [PATCH RESEND 3/5] 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@...aro.org>
---
drivers/net/can/c_can/c_can_platform.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index 8968b6288ac7adc54894f09efbd869c950cce4bf..96d1225c41d0a93627015c4582c1ef1565f53174 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -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,
--
2.43.0
Powered by blists - more mailing lists