From bafc0b43e784511c9bd775eb20e43ea6e113e50f Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 27 Aug 2016 16:50:40 +0000 Subject: [PATCH] Return -1 if we try to set the frequency of a clock but couldn't find it. --- sys/dev/ofw/ofw_clock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ofw/ofw_clock.c b/sys/dev/ofw/ofw_clock.c index ad81356e115..232cf49735b 100644 --- a/sys/dev/ofw/ofw_clock.c +++ b/sys/dev/ofw/ofw_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_clock.c,v 1.6 2016/08/23 21:30:18 kettenis Exp $ */ +/* $OpenBSD: ofw_clock.c,v 1.7 2016/08/27 16:50:40 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -203,7 +203,7 @@ clock_set_frequency_idx(int node, int idx, uint32_t freq) len = OF_getproplen(node, "clocks"); if (len <= 0) - return 0; + return -1; clocks = malloc(len, M_TEMP, M_WAITOK); OF_getpropintarray(node, "clocks", clocks, len); @@ -229,7 +229,7 @@ clock_set_frequency(int node, const char *name, uint32_t freq) idx = clock_index(node, name); if (idx == -1) - return 0; + return -1; return clock_set_frequency_idx(node, idx, freq); } -- 2.20.1