diff mbox

[V3,1/3] hdata/vpd: Reorganize VPD code

Message ID 148877817960.31016.12409558294342193031.stgit@thinktux.in.ibm.com
State Superseded
Headers show

Commit Message

Ananth N Mavinakayanahalli March 6, 2017, 5:29 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>
---
 hdata/vpd.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Vasant Hegde March 13, 2017, 11:54 a.m. UTC | #1
On 03/06/2017 10:59 AM, Ananth N Mavinakayanahalli wrote:
> 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>

-Vasant
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);