git: 3cbf6518d6ee - main - fb: Add a default getinfo method

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Tue, 21 Jun 2022 13:55:55 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=3cbf6518d6eea08e0fbe6d7c609debac5ab31992

commit 3cbf6518d6eea08e0fbe6d7c609debac5ab31992
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-06-21 13:52:49 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-06-21 13:52:49 +0000

    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;