support.c 666 B

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