fbdev: Simplify fb_is_primary_device for x86
[linux-2.6-block.git] / arch / x86 / video / fbdev.c
1 /*
2  * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com>
3  *
4  * This file is subject to the terms and conditions of the GNU General Public
5  * License.  See the file COPYING in the main directory of this archive
6  * for more details.
7  *
8  */
9 #include <linux/fb.h>
10 #include <linux/pci.h>
11 #include <linux/module.h>
12 #include <linux/vgaarb.h>
13
14 int fb_is_primary_device(struct fb_info *info)
15 {
16         struct device *device = info->device;
17         struct pci_dev *pci_dev;
18
19         if (!device || !dev_is_pci(device))
20                 return 0;
21
22         pci_dev = to_pci_dev(device);
23
24         if (pci_dev == vga_default_device())
25                 return 1;
26         return 0;
27 }
28 EXPORT_SYMBOL(fb_is_primary_device);
29 MODULE_LICENSE("GPL");