blob: 4db42bff8c603ee216345bba6143ad5f5efd3dec [file] [log] [blame]
Antonino A. Daplas317b3c22007-07-17 04:05:28 -07001/*
Antonino A. Daplas317b3c22007-07-17 04:05:28 -07002 *
3 * Copyright (C) 2007 Antonino Daplas <adaplas@gmail.com>
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file COPYING in the main directory of this archive
7 * for more details.
8 *
9 */
10#include <linux/fb.h>
11#include <linux/pci.h>
12
13int fb_is_primary_device(struct fb_info *info)
14{
Antonino A. Daplas623e71b2007-07-17 04:05:28 -070015 struct device *device = info->device;
Antonino A. Daplas317b3c22007-07-17 04:05:28 -070016 struct pci_dev *pci_dev = NULL;
17 struct resource *res = NULL;
18 int retval = 0;
19
Antonino A. Daplas317b3c22007-07-17 04:05:28 -070020 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}
31EXPORT_SYMBOL(fb_is_primary_device);