diff mbox

[1/4] hdat: Populate model property with 'Unknown' in error path

Message ID 20170402110729.4785-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Vasant Hegde April 2, 2017, 11:07 a.m. UTC
Linux kernel refers to model and sytem-id properties. Also some of
the user space tools refers these properties. Hence in error path
fill model/system-id property with "Unknown".

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hdata/vpd.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Stewart Smith April 5, 2017, 7:59 a.m. UTC | #1
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> Linux kernel refers to model and sytem-id properties. Also some of
> the user space tools refers these properties. Hence in error path
> fill model/system-id property with "Unknown".
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Thanks, series merged to master as of c3a568c1e8c1ab990bc3e3824567362099d9f119
diff mbox

Patch

diff --git a/hdata/vpd.c b/hdata/vpd.c
index 639fa33..1533f3f 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -535,9 +535,14 @@  static void sysvpd_parse_opp(const void *sysvpd, unsigned int sysvpd_sz)
 	v = vpd_find(sysvpd, sysvpd_sz, "OSYS", "MM", &sz);
 	if (v)
 		dt_add_property_nstr(dt_root, "model", v, sz);
+	else
+		dt_add_property_string(dt_root, "model", "Unknown");
+
 	v = vpd_find(sysvpd, sysvpd_sz, "OSYS", "SS", &sz);
 	if (v)
 		dt_add_property_nstr(dt_root, "system-id", v, sz);
+	else
+		dt_add_property_string(dt_root, "system-id", "Unknown");
 }