blob: 69527688f7940eebc63735a41f3431bdcbf280d6 [file] [log] [blame]
Antonino A. Daplas317b3c22007-07-17 04:05:28 -07001/*
Antonino A. Daplas317b3c22007-07-17 04:05:28 -07002 * 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
12int fb_is_primary_device(struct fb_info *info)
13{
Antonino A. Daplas623e71b2007-07-17 04:05:28 -070014 struct device *device = info->device;
Antonino A. Daplas317b3c22007-07-17 04:05:28 -070015 struct pci_dev *pci_dev = NULL;
16 struct resource *res = NULL;
17 int retval = 0;
18
Antonino A. Daplas317b3c22007-07-17 04:05:28 -070019 if (device)
20 pci_dev = to_pci_dev(device);
21
22 if (pci_dev)
23 res = &pci_dev->resource[PCI_ROM_RESOURCE];
24
25 if (res && res->flags & IORESOURCE_ROM_SHADOW)
26 retval = 1;
27
28 return retval;
29}
30EXPORT_SYMBOL(fb_is_primary_device);
Adrian Bunk7b04fa02008-05-02 13:32:32 -070031MODULE_LICENSE("GPL");