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/877f93a1f83a
branches:  trunk
changeset: 933160:877f93a1f83a
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 a347b3e9b51a -r 877f93a1f83a 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