Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt Modified debug message.



details:   https://anonhg.NetBSD.org/src/rev/f3190a0ecb3c
branches:  trunk
changeset: 972222:f3190a0ecb3c
user:      hkenken <hkenken%NetBSD.org@localhost>
date:      Wed May 20 05:24:35 2020 +0000

description:
Modified debug message.

diffstat:

 sys/dev/fdt/pwm_backlight.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r aba092cba2bc -r f3190a0ecb3c sys/dev/fdt/pwm_backlight.c
--- a/sys/dev/fdt/pwm_backlight.c       Wed May 20 05:10:42 2020 +0000
+++ b/sys/dev/fdt/pwm_backlight.c       Wed May 20 05:24:35 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pwm_backlight.c,v 1.7 2020/01/22 07:29:23 mrg Exp $ */
+/* $NetBSD: pwm_backlight.c,v 1.8 2020/05/20 05:24:35 hkenken Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.7 2020/01/22 07:29:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.8 2020/05/20 05:24:35 hkenken Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -146,7 +146,9 @@
        if (index >= sc->sc_nlevels)
                return;
 
-       aprint_debug_dev(sc->sc_dev, "set duty cycle to %u%%\n", sc->sc_levels[index]);
+       KASSERT(sc->sc_levels[sc->sc_nlevels - 1] != 0);
+       aprint_debug_dev(sc->sc_dev, "set duty cycle to %u%%\n",
+           (100 * sc->sc_levels[index]) / sc->sc_levels[sc->sc_nlevels - 1]);
 
        pwm_disable(sc->sc_pwm);
        pwm_get_config(sc->sc_pwm, &conf);



Home | Main Index | Thread Index | Old Index