Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Revert acpi_ec.c 1.77.



details:   https://anonhg.NetBSD.org/src/rev/b385f3f10d65
branches:  trunk
changeset: 971039:b385f3f10d65
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Apr 12 01:11:23 2020 +0000

description:
Revert acpi_ec.c 1.77.

We will do this another way.

ok msaitoh

diffstat:

 sys/dev/acpi/acpi_ec.c |  19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r 4fbcd10a6325 -r b385f3f10d65 sys/dev/acpi/acpi_ec.c
--- a/sys/dev/acpi/acpi_ec.c    Sun Apr 12 01:10:53 2020 +0000
+++ b/sys/dev/acpi/acpi_ec.c    Sun Apr 12 01:11:23 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_ec.c,v 1.77 2019/08/06 01:53:47 msaitoh Exp $     */
+/*     $NetBSD: acpi_ec.c,v 1.78 2020/04/12 01:11:23 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.77 2019/08/06 01:53:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.78 2020/04/12 01:11:23 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
@@ -679,15 +679,20 @@
        if (func == ACPI_READ)
                *value = 0;
 
-       for (addr = paddr; addr < (paddr + width / 8); addr++, reg++) {
-               if (func == ACPI_READ)
+       do {
+               switch (func) {
+               case ACPI_READ:
                        rv = acpiec_read(dv, addr, reg);
-               else
+                       break;
+               case ACPI_WRITE:
                        rv = acpiec_write(dv, addr, *reg);
-
+                       break;
+               }
                if (rv != AE_OK)
                        break;
-       }
+               addr++;
+               reg++;
+       } while (addr < (paddr + width / 8));
 
        return rv;
 }



Home | Main Index | Thread Index | Old Index