From c8782dbeaaa84eea4aea1c142c2ce34192de0c84 Mon Sep 17 00:00:00 2001 From: thorpej Date: Sun, 24 Jan 2021 16:23:05 +0000 Subject: Change of_search_compable() to return NULL on no-match, which is much more sensible than the previous behavior. As such, back out rev 1.7 of sunxi_sramc.c. All other of_search_compable() call sites have been audited. --- sys/dev/ofw/ofw_subr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/ofw/ofw_subr.c b/sys/dev/ofw/ofw_subr.c index f74b7129ca6..245f8c7b216 100644 --- a/sys/dev/ofw/ofw_subr.c +++ b/sys/dev/ofw/ofw_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.43 2021/01/20 00:41:15 jmcneill Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.44 2021/01/24 16:23:05 thorpej Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.43 2021/01/20 00:41:15 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.44 2021/01/24 16:23:05 thorpej Exp $"); #include #include @@ -253,9 +253,9 @@ of_search_compatible(int phandle, for (; compat_data->compat != NULL; compat_data++) { const char *compat[] = { compat_data->compat, NULL }; if (of_match_compatible(phandle, compat)) - break; + return compat_data; } - return compat_data; + return NULL; } /* -- cgit