diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-08-22 22:07:00 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-08-22 22:07:00 +0000 |
commit | c4ee5ffdb53a04eb1ee24e0011c21bd6fcbc1321 (patch) | |
tree | a7db0c6c4e30860ddffcb9ea454585ac95073ff5 | |
parent | 20838edc53ae3b47ed56425a875c26009c3482f8 (diff) |
Fix two small bugs in the new reset API code.
-rw-r--r-- | sys/dev/ofw/ofw_clock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ofw/ofw_clock.c b/sys/dev/ofw/ofw_clock.c index 443b46795ba..34ed1342609 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.4 2016/08/22 19:28:27 kettenis Exp $ */ +/* $OpenBSD: ofw_clock.c,v 1.5 2016/08/22 22:06:59 kettenis Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -326,7 +326,8 @@ reset_assert_cells(uint32_t *cells, int assert) break; } - rd->rd_reset(rd->rd_cookie, &cells[1], assert); + if (rd && rd->rd_reset) + rd->rd_reset(rd->rd_cookie, &cells[1], assert); } uint32_t * @@ -390,7 +391,7 @@ reset_do_assert_idx(int node, int idx, int assert) OF_getpropintarray(node, "resets", resets, len); reset = resets; - while (reset && resets < resets + (len / sizeof(uint32_t))) { + while (reset && reset < resets + (len / sizeof(uint32_t))) { if (idx <= 0) reset_assert_cells(reset, assert); if (idx == 0) |