From: Lothar Waßmann Date: Tue, 16 Jun 2020 07:06:53 +0000 (+0200) Subject: karo: fdt: fix error handling for reg-can-xcvr X-Git-Tag: KARO_TX6-2020-09-18~5 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=94bd268f9275958c4b0fa7613eaa503ac31129b0;hp=826471d6da53f43b6068db2b1a65095c4d38cdc8 karo: fdt: fix error handling for reg-can-xcvr --- 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)); }