diff mbox

[V4,1/4] hdata/vpd: Reorganize VPD code

Message ID 148948723452.25437.16956459316985787450.stgit@thinktux.in.ibm.com
State Accepted
Headers show

Commit Message

Ananth N Mavinakayanahalli March 14, 2017, 10:27 a.m. UTC
To make it convenient to add OpenPOWER platform support. No change in
functionality.

This series has been tested on a Witherspoon. The HDAT has the corresponding
properties, but is not populated with the right values (serial number, etc).

Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hdata/vpd.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Stewart Smith March 31, 2017, 7:01 a.m. UTC | #1
Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> writes:
> To make it convenient to add OpenPOWER platform support. No change in
> functionality.
>
> This series has been tested on a Witherspoon. The HDAT has the corresponding
> properties, but is not populated with the right values (serial number, etc).
>
> Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

series merged to master as of d38b15fe973676f71673e227d8190d72da5cd774
diff mbox

Patch

diff --git a/hdata/vpd.c b/hdata/vpd.c
index c61621d..4c787c6 100644
--- a/hdata/vpd.c
+++ b/hdata/vpd.c
@@ -23,6 +23,8 @@ 
 #include "hdata.h"
 #include <inttypes.h>
 
+static bool op_platform;
+
 struct card_info {
 	const char *ccin; 	/* Customer card identification number */
 	const char *description;
@@ -571,9 +573,10 @@  static void sysvpd_parse(void)
 	}
 
 	/* Look for the new OpenPower "OSYS" first */
-	if (vpd_find_record(sysvpd, sysvpd_sz, "OSYS", NULL))
+	if (vpd_find_record(sysvpd, sysvpd_sz, "OSYS", NULL)) {
+		op_platform = true;
 		sysvpd_parse_opp(sysvpd, sysvpd_sz);
-	else
+	} else
 		sysvpd_parse_legacy(sysvpd, sysvpd_sz);
 }
 
@@ -651,15 +654,15 @@  void vpd_parse(void)
 {
 	const struct HDIF_common_hdr *fruvpd_hdr;
 
+	/* System VPD uses the VSYS record, so its special */
+	sysvpd_parse();
+
 	/* Enclosure */
 	_vpd_parse(spira.ntuples.nt_enclosure_vpd);
 
 	/* Backplane */
 	_vpd_parse(spira.ntuples.backplane_vpd);
 
-	/* System VPD uses the VSYS record, so its special */
-	sysvpd_parse();
-
 	/* clock card -- does this use the FRUVPD sig? */
 	_vpd_parse(spira.ntuples.clock_vpd);