of_device.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef _ASM_POWERPC_OF_DEVICE_H
  2. #define _ASM_POWERPC_OF_DEVICE_H
  3. #ifdef __KERNEL__
  4. #include <linux/device.h>
  5. #include <linux/mod_devicetable.h>
  6. #include <asm/prom.h>
  7. /*
  8. * The of_device is a kind of "base class" that is a superset of
  9. * struct device for use by devices attached to an OF node and
  10. * probed using OF properties
  11. */
  12. struct of_device
  13. {
  14. struct device_node *node; /* to be obsoleted */
  15. u64 dma_mask; /* DMA mask */
  16. struct device dev; /* Generic device interface */
  17. };
  18. #define to_of_device(d) container_of(d, struct of_device, dev)
  19. extern const struct of_device_id *of_match_node(
  20. const struct of_device_id *matches, const struct device_node *node);
  21. extern const struct of_device_id *of_match_device(
  22. const struct of_device_id *matches, const struct of_device *dev);
  23. extern struct of_device *of_dev_get(struct of_device *dev);
  24. extern void of_dev_put(struct of_device *dev);
  25. extern int of_device_register(struct of_device *ofdev);
  26. extern void of_device_unregister(struct of_device *ofdev);
  27. extern void of_release_dev(struct device *dev);
  28. #endif /* __KERNEL__ */
  29. #endif /* _ASM_POWERPC_OF_DEVICE_H */