diff --git a/sys/dev/drm2/drm_fb_helper.c b/sys/dev/drm2/drm_fb_helper.c index 90a0098..fd2aa2d 100644 --- a/sys/dev/drm2/drm_fb_helper.c +++ b/sys/dev/drm2/drm_fb_helper.c @@ -936,7 +936,6 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, int gamma_size = 0; #if defined(__FreeBSD__) struct vt_kms_softc *sc; - device_t kdev; #endif memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size)); @@ -1037,18 +1036,21 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, } #if defined(__FreeBSD__) +#ifdef DEV_VT if (new_fb) { + device_t kdev; device_t fbd; int ret; kdev = fb_helper->dev->device; fbd = device_add_child(kdev, "fbd", device_get_unit(kdev)); - ret = device_probe_and_attach(fbd); -#ifdef DEV_VT - if (ret != 0) - DRM_ERROR("Failed to attach fbd device: %d\n", ret); -#endif + if (fbd != NULL) { + ret = device_probe_and_attach(fbd); + if (ret != 0) + DRM_ERROR("Failed to attach fbd device: %d\n", ret); + } } +#endif #else if (new_fb) { info->var.pixclock = 0;