summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-04-02 00:34:48 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-04-02 00:34:48 +0000
commitb54c4ee0cba313b9404baa78fdc8883273e79883 (patch)
treefb80bc8bb8a5eb6349d2d99e24657c76be686e70 /sys
parent26c052b495d945c0f2381f072ebbfb7d8f38080d (diff)
Make the gpio intr_establish callback return an int so the same function
pointer can be used with gpio and acpi intr_establish. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/amltypes.h4
-rw-r--r--sys/dev/acpi/bytgpio.c8
-rw-r--r--sys/dev/acpi/sdhc_acpi.c8
3 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/acpi/amltypes.h b/sys/dev/acpi/amltypes.h
index 8041141df03..825b7671943 100644
--- a/sys/dev/acpi/amltypes.h
+++ b/sys/dev/acpi/amltypes.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amltypes.h,v 1.42 2016/03/30 09:56:10 kettenis Exp $ */
+/* $OpenBSD: amltypes.h,v 1.43 2016/04/02 00:34:47 jsg Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -367,7 +367,7 @@ struct acpi_pci {
struct acpi_gpio {
void *cookie;
int (*read_pin)(void *, int);
- void (*intr_establish)(void *, int, int, void (*)(void *), void *);
+ void (*intr_establish)(void *, int, int, int (*)(void *), void *);
};
struct aml_node {
diff --git a/sys/dev/acpi/bytgpio.c b/sys/dev/acpi/bytgpio.c
index df69aa1187f..dd1f27e7592 100644
--- a/sys/dev/acpi/bytgpio.c
+++ b/sys/dev/acpi/bytgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bytgpio.c,v 1.4 2016/03/30 09:56:10 kettenis Exp $ */
+/* $OpenBSD: bytgpio.c,v 1.5 2016/04/02 00:34:47 jsg Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -37,7 +37,7 @@
#define BYTGPIO_IRQ_TS_2 0x808
struct bytgpio_intrhand {
- void (*ih_func)(void *);
+ int (*ih_func)(void *);
void *ih_arg;
};
@@ -105,7 +105,7 @@ const int byt_sus_pins[] = {
int bytgpio_parse_resources(union acpi_resource *, void *);
int bytgpio_read_pin(void *, int);
-void bytgpio_intr_establish(void *, int, int, void (*)(), void *);
+void bytgpio_intr_establish(void *, int, int, int (*)(), void *);
int bytgpio_intr(void *);
int
@@ -235,7 +235,7 @@ bytgpio_read_pin(void *cookie, int pin)
void
bytgpio_intr_establish(void *cookie, int pin, int flags,
- void (*func)(void *), void *arg)
+ int (*func)(void *), void *arg)
{
struct bytgpio_softc *sc = cookie;
uint32_t reg;
diff --git a/sys/dev/acpi/sdhc_acpi.c b/sys/dev/acpi/sdhc_acpi.c
index b9b688d6606..e09ad8b05f4 100644
--- a/sys/dev/acpi/sdhc_acpi.c
+++ b/sys/dev/acpi/sdhc_acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc_acpi.c,v 1.5 2016/03/30 10:00:08 kettenis Exp $ */
+/* $OpenBSD: sdhc_acpi.c,v 1.6 2016/04/02 00:34:47 jsg Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -69,7 +69,7 @@ const char *sdhc_hids[] = {
int sdhc_acpi_parse_resources(union acpi_resource *, void *);
int sdhc_acpi_card_detect(struct sdhc_softc *);
-void sdhc_acpi_card_detect_intr(void *);
+int sdhc_acpi_card_detect_intr(void *);
int
sdhc_acpi_match(struct device *parent, void *match, void *aux)
@@ -188,10 +188,12 @@ sdhc_acpi_card_detect(struct sdhc_softc *ssc)
return !gpio->read_pin(gpio->cookie, pin);
}
-void
+int
sdhc_acpi_card_detect_intr(void *arg)
{
struct sdhc_acpi_softc *sc = arg;
sdhc_needs_discover(&sc->sc);
+
+ return (1);
}