summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-07-05 21:18:33 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-07-05 21:18:33 +0000
commit945f6b1a8a8c9593f17410985d9a0ade54789f16 (patch)
tree81e914792337614f7c997fed3e0b2bea8047b7c4
parentfc0a320939c85d0f665d9f549fbc92b1f785f606 (diff)
Add submatch function for use with config_found_sm(9).
ok miod@
-rw-r--r--sys/dev/wscons/wsdisplay.c16
-rw-r--r--sys/dev/wscons/wsdisplayvar.h3
2 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index d62d9f75abc..9a87bbe33ae 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.110 2013/06/15 21:35:15 kettenis Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.111 2013/07/05 21:18:32 kettenis Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -668,6 +668,20 @@ wsemuldisplaydevprint(void *aux, const char *pnp)
return (UNCONF);
}
+/* Submatch function (for parent devices). */
+int
+wsemuldisplaysubmatch(struct device *parent, void *match, void *aux)
+{
+ extern struct cfdriver wsdisplay_cd;
+ struct cfdata *cf = match;
+
+ /* only allow wsdisplay to attach */
+ if (cf->cf_driver == &wsdisplay_cd)
+ return ((*cf->cf_attach->ca_match)(parent, match, aux));
+
+ return (0);
+}
+
void
wsdisplay_common_attach(struct wsdisplay_softc *sc, int console, int kbdmux,
const struct wsscreen_list *scrdata,
diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h
index d7038a12b40..ae4afc1739e 100644
--- a/sys/dev/wscons/wsdisplayvar.h
+++ b/sys/dev/wscons/wsdisplayvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplayvar.h,v 1.24 2010/03/30 17:40:55 oga Exp $ */
+/* $OpenBSD: wsdisplayvar.h,v 1.25 2013/07/05 21:18:32 kettenis Exp $ */
/* $NetBSD: wsdisplayvar.h,v 1.30 2005/02/04 02:10:49 perry Exp $ */
/*
@@ -167,6 +167,7 @@ struct wscons_syncops {
void wsdisplay_cnattach(const struct wsscreen_descr *, void *,
int, int, long);
int wsemuldisplaydevprint(void *, const char *);
+int wsemuldisplaysubmatch(struct device *, void *, void *);
/*
* Console interface.