summaryrefslogtreecommitdiff
path: root/arch/sparc/video
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-04-17 14:56:49 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2023-04-20 10:05:12 +0200
commit4eec0b3048fcd74b504c2a6828a07f133a8ab508 (patch)
tree1472e4b7c1747a8505151affeaad444c6a451e37 /arch/sparc/video
parentb6cf29637be638a6846d2d297d80cf7c6fb74faf (diff)
arch/sparc: Implement fb_is_primary_device() in source file
Other architectures implment fb_is_primary_device() in a source file. Do the same on sparc. No functional changes, but allows to remove several include statement from <asm/fb.h>. v2: * don't include <asm/prom.h> in header file Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Helge Deller <deller@gmx.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230417125651.25126-18-tzimmermann@suse.de
Diffstat (limited to 'arch/sparc/video')
-rw-r--r--arch/sparc/video/Makefile3
-rw-r--r--arch/sparc/video/fbdev.c24
2 files changed, 27 insertions, 0 deletions
diff --git a/arch/sparc/video/Makefile b/arch/sparc/video/Makefile
new file mode 100644
index 000000000000..6baddbd58e4d
--- /dev/null
+++ b/arch/sparc/video/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_FB) += fbdev.o
diff --git a/arch/sparc/video/fbdev.c b/arch/sparc/video/fbdev.c
new file mode 100644
index 000000000000..dadd5799fbb3
--- /dev/null
+++ b/arch/sparc/video/fbdev.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/console.h>
+#include <linux/fb.h>
+#include <linux/module.h>
+
+#include <asm/fb.h>
+#include <asm/prom.h>
+
+int fb_is_primary_device(struct fb_info *info)
+{
+ struct device *dev = info->device;
+ struct device_node *node;
+
+ if (console_set_on_cmdline)
+ return 0;
+
+ node = dev->of_node;
+ if (node && node == of_console_device)
+ return 1;
+
+ return 0;
+}
+EXPORT_SYMBOL(fb_is_primary_device);