summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@openbsd.org>2013-07-06 23:52:12 +0200
committerJonathan Gray <jsg@jsg.id.au>2013-08-12 10:44:51 +1000
commit0f8d3c71ec75dc0209179be9f8251dc06b2812dc (patch)
tree9b5d65addf179b266f33abbeaa4696be1dcfb72a /sys
parent722d33806bd98521f8d3b4878dfbd6e938c3ce75 (diff)
add submatch function for use with config_found_sm and use it
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/drm_drv.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c
index 374dfc771e5..952d64ecf3e 100644
--- a/sys/dev/pci/drm/drm_drv.c
+++ b/sys/dev/pci/drm/drm_drv.c
@@ -63,6 +63,7 @@ int drm_probe(struct device *, void *, void *);
int drm_detach(struct device *, int);
int drm_activate(struct device *, int);
int drmprint(void *, const char *);
+int drmsubmatch(struct device *, void *, void *);
int drm_dequeue_event(struct drm_device *, struct drm_file *, size_t,
struct drm_pending_event **);
@@ -124,7 +125,7 @@ drm_attach_pci(struct drm_driver_info *driver, struct pci_attach_args *pa,
snprintf(arg.busid, arg.busid_len, "pci:%04x:%02x:%02x.%1x",
pa->pa_domain, pa->pa_bus, pa->pa_device, pa->pa_function);
- return (config_found(dev, &arg, drmprint));
+ return (config_found_sm(dev, &arg, drmprint, drmsubmatch));
}
int
@@ -136,6 +137,18 @@ drmprint(void *aux, const char *pnp)
}
int
+drmsubmatch(struct device *parent, void *match, void *aux)
+{
+ extern struct cfdriver drm_cd;
+ struct cfdata *cf = match;
+
+ /* only allow drm to attach */
+ if (cf->cf_driver == &drm_cd)
+ return ((*cf->cf_attach->ca_match)(parent, match, aux));
+ return (0);
+}
+
+int
drm_pciprobe(struct pci_attach_args *pa, const struct drm_pcidev *idlist)
{
const struct drm_pcidev *id_entry;