summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-08-27 16:50:41 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-08-27 16:50:41 +0000
commitb3653568a75396591dcb98c71f4a239df058d893 (patch)
tree0a9ba3f56996f1f109119a103a53709bd8cff33d /sys/dev
parentcc730ef26bd938b6c8ce00a7d6ea9f45bb7cfb9c (diff)
Return -1 if we try to set the frequency of a clock but couldn't find it.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ofw/ofw_clock.c6
1 files 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);
}