Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/imx Fix wrong divider setting.



details:   https://anonhg.NetBSD.org/src/rev/28708e7f9cd2
branches:  trunk
changeset: 934246:28708e7f9cd2
user:      hkenken <hkenken%NetBSD.org@localhost>
date:      Mon Jun 08 07:48:57 2020 +0000

description:
Fix wrong divider setting.

diffstat:

 sys/arch/arm/imx/imx6_ccm.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ae042759fefc -r 28708e7f9cd2 sys/arch/arm/imx/imx6_ccm.c
--- a/sys/arch/arm/imx/imx6_ccm.c       Mon Jun 08 05:05:43 2020 +0000
+++ b/sys/arch/arm/imx/imx6_ccm.c       Mon Jun 08 07:48:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imx6_ccm.c,v 1.17 2020/06/05 02:30:54 hkenken Exp $    */
+/*     $NetBSD: imx6_ccm.c,v 1.18 2020/06/08 07:48:57 hkenken Exp $    */
 
 /*
  * Copyright (c) 2010-2012, 2014  Genetec Corporation.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.17 2020/06/05 02:30:54 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_ccm.c,v 1.18 2020/06/08 07:48:57 hkenken Exp $");
 
 #include "opt_cputypes.h"
 
@@ -1295,7 +1295,7 @@
        KASSERT(parent != NULL);
 
        u_int rate_parent = imxccm_clk_get_rate(sc, &parent->base);
-       u_int divider = rate_parent / rate;
+       u_int divider = uimax(1, rate_parent / rate);
 
        bus_space_handle_t ioh;
        if (div->base == IMX6_CLK_REG_CCM_ANALOG)



Home | Main Index | Thread Index | Old Index