Antonino A. Daplas | 317b3c2 | 2007-07-17 04:05:28 -0700 | [diff] [blame] | 1 | /* |
Antonino A. Daplas | 317b3c2 | 2007-07-17 04:05:28 -0700 | [diff] [blame] | 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> |
Paul Gortmaker | 7c52d55 | 2011-05-27 12:33:10 -0400 | [diff] [blame] | 11 | #include <linux/module.h> |
Antonino A. Daplas | 317b3c2 | 2007-07-17 04:05:28 -0700 | [diff] [blame] | 12 | |
| 13 | int fb_is_primary_device(struct fb_info *info) |
| 14 | { |
Antonino A. Daplas | 623e71b | 2007-07-17 04:05:28 -0700 | [diff] [blame] | 15 | struct device *device = info->device; |
Antonino A. Daplas | 317b3c2 | 2007-07-17 04:05:28 -0700 | [diff] [blame] | 16 | struct pci_dev *pci_dev = NULL; |
| 17 | struct resource *res = NULL; |
| 18 | int retval = 0; |
| 19 | |
Antonino A. Daplas | 317b3c2 | 2007-07-17 04:05:28 -0700 | [diff] [blame] | 20 | if (device) |
| 21 | pci_dev = to_pci_dev(device); |
| 22 | |
| 23 | if (pci_dev) |
| 24 | res = &pci_dev->resource[PCI_ROM_RESOURCE]; |
| 25 | |
| 26 | if (res && res->flags & IORESOURCE_ROM_SHADOW) |
| 27 | retval = 1; |
| 28 | |
| 29 | return retval; |
| 30 | } |
| 31 | EXPORT_SYMBOL(fb_is_primary_device); |
Adrian Bunk | 7b04fa0 | 2008-05-02 13:32:32 -0700 | [diff] [blame] | 32 | MODULE_LICENSE("GPL"); |