14eec0b30SThomas Zimmermann // SPDX-License-Identifier: GPL-2.0 24eec0b30SThomas Zimmermann 34eec0b30SThomas Zimmermann #include <linux/console.h> 44eec0b30SThomas Zimmermann #include <linux/fb.h> 54eec0b30SThomas Zimmermann #include <linux/module.h> 64eec0b30SThomas Zimmermann 74eec0b30SThomas Zimmermann #include <asm/prom.h> 84eec0b30SThomas Zimmermann fb_is_primary_device(struct fb_info * info)94eec0b30SThomas Zimmermannint fb_is_primary_device(struct fb_info *info) 104eec0b30SThomas Zimmermann { 114eec0b30SThomas Zimmermann struct device *dev = info->device; 124eec0b30SThomas Zimmermann struct device_node *node; 134eec0b30SThomas Zimmermann 144eec0b30SThomas Zimmermann if (console_set_on_cmdline) 154eec0b30SThomas Zimmermann return 0; 164eec0b30SThomas Zimmermann 174eec0b30SThomas Zimmermann node = dev->of_node; 184eec0b30SThomas Zimmermann if (node && node == of_console_device) 194eec0b30SThomas Zimmermann return 1; 204eec0b30SThomas Zimmermann 214eec0b30SThomas Zimmermann return 0; 224eec0b30SThomas Zimmermann } 234eec0b30SThomas Zimmermann EXPORT_SYMBOL(fb_is_primary_device); 24*861c249cSThomas Zimmermann 25*861c249cSThomas Zimmermann MODULE_DESCRIPTION("Sparc fbdev helpers"); 26*861c249cSThomas Zimmermann MODULE_LICENSE("GPL"); 27