From 94bd268f9275958c4b0fa7613eaa503ac31129b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Tue, 16 Jun 2020 09:06:53 +0200 Subject: [PATCH] karo: fdt: fix error handling for reg-can-xcvr --- board/karo/common/fdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/karo/common/fdt.c b/board/karo/common/fdt.c index 7f6ac56298..fe3520b863 100644 --- a/board/karo/common/fdt.c +++ b/board/karo/common/fdt.c @@ -418,10 +418,10 @@ void karo_fdt_fixup_flexcan(void *blob, int xcvr_present) debug("Disabling CAN XCVR\n"); ret = fdt_find_and_setprop(blob, "reg-can-xcvr", "status", xcvr_status, strlen(xcvr_status) + 1, 1); - if (ret == -FDT_ERR_NOTFOUND) + if (ret == -FDT_ERR_NOTFOUND || ret == -FDT_ERR_BADPATH) ret = fdt_find_and_setprop(blob, "reg_can_xcvr", "status", xcvr_status, strlen(xcvr_status) + 1, 1); - if (ret != -FDT_ERR_NOTFOUND) + if (ret && ret != -FDT_ERR_NOTFOUND && ret != -FDT_ERR_BADPATH) printf("Failed to disable CAN transceiver switch: %s\n", fdt_strerror(ret)); } -- 2.39.2