proc.c 521 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright (C) 2016 Imagination Technologies
  4. * Author: Paul Burton <[email protected]>
  5. */
  6. #include <linux/of.h>
  7. #include <asm/bootinfo.h>
  8. char *system_type;
  9. const char *get_system_type(void)
  10. {
  11. const char *str;
  12. int err;
  13. if (system_type)
  14. return system_type;
  15. err = of_property_read_string(of_root, "model", &str);
  16. if (!err)
  17. return str;
  18. err = of_property_read_string_index(of_root, "compatible", 0, &str);
  19. if (!err)
  20. return str;
  21. return "Unknown";
  22. }