summaryrefslogtreecommitdiffstats
path: root/sys/dev/gpio/gpio.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2004-11-22 15:37:42 +0000
committerreyk <reyk@openbsd.org>2004-11-22 15:37:42 +0000
commita92078b1cac03af7c1f11b09689ead2020538f79 (patch)
treea44cd9c7705b92847a61aa377b51e389bcecc774 /sys/dev/gpio/gpio.c
parentsimplify loop iteration (diff)
downloadwireguard-openbsd-a92078b1cac03af7c1f11b09689ead2020538f79.tar.xz
wireguard-openbsd-a92078b1cac03af7c1f11b09689ead2020538f79.zip
added detach function to support hotpluggable gpios.
ok grange@
Diffstat (limited to 'sys/dev/gpio/gpio.c')
-rw-r--r--sys/dev/gpio/gpio.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/gpio/gpio.c b/sys/dev/gpio/gpio.c
index 42bad4f66ff..880beba48d2 100644
--- a/sys/dev/gpio/gpio.c
+++ b/sys/dev/gpio/gpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gpio.c,v 1.2 2004/09/15 17:47:52 grange Exp $ */
+/* $OpenBSD: gpio.c,v 1.3 2004/11/22 15:37:42 reyk Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -40,13 +40,15 @@ struct gpio_softc {
int gpio_match(struct device *, void *, void *);
void gpio_attach(struct device *, struct device *, void *);
+int gpio_detach(struct device *, int);
int gpio_search(struct device *, void *, void *);
int gpio_print(void *, const char *);
struct cfattach gpio_ca = {
sizeof (struct gpio_softc),
gpio_match,
- gpio_attach
+ gpio_attach,
+ gpio_detach
};
struct cfdriver gpio_cd = {
@@ -85,6 +87,12 @@ gpio_attach(struct device *parent, struct device *self, void *aux)
}
int
+gpio_detach(struct device *parent, int flags)
+{
+ return (0);
+}
+
+int
gpio_search(struct device *parent, void *arg, void *aux)
{
struct cfdata *cf = arg;