finddevice.c 699 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) Paul Mackerras 1997.
  3. * Copyright (C) Leigh Brown 2002.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #include "of1275.h"
  11. phandle
  12. finddevice(const char *name)
  13. {
  14. struct prom_args {
  15. char *service;
  16. int nargs;
  17. int nret;
  18. const char *devspec;
  19. phandle device;
  20. } args;
  21. args.service = "finddevice";
  22. args.nargs = 1;
  23. args.nret = 1;
  24. args.devspec = name;
  25. args.device = OF_INVALID_HANDLE;
  26. (*of_prom_entry)(&args);
  27. return args.device;
  28. }