proc.c 674 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C) 2016 Imagination Technologies
  3. * Author: Paul Burton <paul.burton@imgtec.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version.
  9. */
  10. #include <linux/of.h>
  11. #include <asm/bootinfo.h>
  12. const char *get_system_type(void)
  13. {
  14. const char *str;
  15. int err;
  16. err = of_property_read_string(of_root, "model", &str);
  17. if (!err)
  18. return str;
  19. err = of_property_read_string_index(of_root, "compatible", 0, &str);
  20. if (!err)
  21. return str;
  22. return "Unknown";
  23. }