diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-07-23 14:03:42 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-08-05 10:49:31 +0800 |
commit | 6897abaa97a02e0ab8ac07209a5e4966bfe101c5 (patch) | |
tree | 6592de1ffd41310aeefdbe58d41928f21baeed71 /discover/platform.c | |
parent | 052961eb2e8279f103c091e850c317da335c0207 (diff) | |
download | talos-petitboot-6897abaa97a02e0ab8ac07209a5e4966bfe101c5.tar.gz talos-petitboot-6897abaa97a02e0ab8ac07209a5e4966bfe101c5.zip |
discover: Use platform code to read sysinfo type and identifier
This change uses the platform-specific code to read the system type and
identifier, rather than the pb-sysinfo utility. We introduce a new
callback for struct platform:
int (*get_sysinfo)(struct platform *, struct system_info *);
- which populates struct system_info with appropriate information.
This means that the system-specific code is kept in one place; rather
than having powerpc-specific device-tree-reading code in the pb-sysinfo
shell script.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/platform.c')
-rw-r--r-- | discover/platform.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/discover/platform.c b/discover/platform.c index 0dced16..65e9ed4 100644 --- a/discover/platform.c +++ b/discover/platform.c @@ -143,6 +143,13 @@ const struct platform *platform_get(void) return platform; } +int platform_get_sysinfo(struct system_info *info) +{ + if (platform && platform->get_sysinfo) + return platform->get_sysinfo(platform, info); + return -1; +} + int config_set(struct config *newconfig) { int rc; |