From 3cbf6518d6eea08e0fbe6d7c609debac5ab31992 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Tue, 21 Jun 2022 15:52:49 +0200 Subject: [PATCH] fb: Add a default getinfo method fb_getinfo is badly designed as it returns either the info if the driver have the method or ENXIO via the kobj stuff if the driver doesn't have it. Add a default method that returns NULL as the code already checks this and it avoid changing the interface. None of the drm drivers supported have this method and it sometimes fails and panic when loading them (for now only usb-c docks seems to be affected). MFC after: 3 days Sponsored by: Beckhoff Automation GmbH & Co. KG --- sys/dev/fb/fb_if.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/fb/fb_if.m b/sys/dev/fb/fb_if.m index 53e4563bb6f5..938cececa409 100644 --- a/sys/dev/fb/fb_if.m +++ b/sys/dev/fb/fb_if.m @@ -3,6 +3,14 @@ INTERFACE fb; +CODE { + static struct fb_info * + fb_default_getinfo(device_t dev) + { + return (NULL); + } +}; + METHOD struct fb_info * getinfo { device_t dev; -}; +} DEFAULT fb_default_getinfo;