support.c 636 B

123456789101112131415161718192021222324252627
  1. /*
  2. * support.c - standard functions for the use of pnp protocol drivers
  3. *
  4. * Copyright 2003 Adam Belay <ambx1@neo.rr.com>
  5. */
  6. #include <linux/module.h>
  7. #include <linux/ctype.h>
  8. #include <linux/pnp.h>
  9. #include "base.h"
  10. /**
  11. * pnp_is_active - Determines if a device is active based on its current
  12. * resources
  13. * @dev: pointer to the desired PnP device
  14. */
  15. int pnp_is_active(struct pnp_dev *dev)
  16. {
  17. if (!pnp_port_start(dev, 0) && pnp_port_len(dev, 0) <= 1 &&
  18. !pnp_mem_start(dev, 0) && pnp_mem_len(dev, 0) <= 1 &&
  19. pnp_irq(dev, 0) == -1 && pnp_dma(dev, 0) == -1)
  20. return 0;
  21. else
  22. return 1;
  23. }
  24. EXPORT_SYMBOL(pnp_is_active);