Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Use acpi_intr_establish



details:   https://anonhg.NetBSD.org/src/rev/aa4fd239ac0d
branches:  trunk
changeset: 446101:aa4fd239ac0d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Nov 23 14:08:40 2018 +0000

description:
Use acpi_intr_establish

diffstat:

 sys/dev/acpi/plgpio_acpi.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 5e6168d5b71b -r aa4fd239ac0d sys/dev/acpi/plgpio_acpi.c
--- a/sys/dev/acpi/plgpio_acpi.c        Fri Nov 23 12:39:18 2018 +0000
+++ b/sys/dev/acpi/plgpio_acpi.c        Fri Nov 23 14:08:40 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: plgpio_acpi.c,v 1.4 2018/10/23 09:19:02 jmcneill Exp $ */
+/* $NetBSD: plgpio_acpi.c,v 1.5 2018/11/23 14:08:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: plgpio_acpi.c,v 1.4 2018/10/23 09:19:02 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plgpio_acpi.c,v 1.5 2018/11/23 14:08:40 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -40,6 +40,7 @@
 
 #include <dev/acpi/acpireg.h>
 #include <dev/acpi/acpivar.h>
+#include <dev/acpi/acpi_intr.h>
 #include <dev/acpi/acpi_event.h>
 
 #include <dev/gpio/gpiovar.h>
@@ -108,7 +109,7 @@
        }
 
        irq = acpi_res_irq(&res, 0);
-       if (mem == NULL) {
+       if (irq == NULL) {
                aprint_error_dev(self, "couldn't find irq resource\n");
                goto done;
        }
@@ -130,8 +131,8 @@
                goto done;
        }
 
-       const int type = (irq->ar_type == ACPI_EDGE_SENSITIVE) ? IST_EDGE : IST_LEVEL;
-       ih = intr_establish(irq->ar_irq, IPL_VM, type, plgpio_acpi_intr, asc);
+       ih = acpi_intr_establish(self, (uint64_t)asc->sc_handle,
+           IPL_VM, false, plgpio_acpi_intr, asc, device_xname(self));
        if (ih == NULL)
                aprint_error_dev(self, "couldn't establish interrupt\n");
 



Home | Main Index | Thread Index | Old Index