fbdev.c 685 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. *
  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. int fb_is_primary_device(struct fb_info *info)
  13. {
  14. struct device *device = info->device;
  15. struct pci_dev *pci_dev = NULL;
  16. struct resource *res = NULL;
  17. int retval = 0;
  18. if (device)
  19. pci_dev = to_pci_dev(device);
  20. if (pci_dev)
  21. res = &pci_dev->resource[PCI_ROM_RESOURCE];
  22. if (res && res->flags & IORESOURCE_ROM_SHADOW)
  23. retval = 1;
  24. return retval;
  25. }
  26. EXPORT_SYMBOL(fb_is_primary_device);