fbdev.c 705 B

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