diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2017-08-28 12:48:00 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-09-04 20:45:35 -0500 |
commit | 80b6fb7a01e86e4e72353cf970822d80ff40da2c (patch) | |
tree | 85a41cd84a9ff884d6bee9f52d10235959c20635 | |
parent | 2a73bbed50c3daefb88a362f29ef6f415e05043b (diff) | |
download | skiboot-80b6fb7a01e86e4e72353cf970822d80ff40da2c.zip skiboot-80b6fb7a01e86e4e72353cf970822d80ff40da2c.tar.gz skiboot-80b6fb7a01e86e4e72353cf970822d80ff40da2c.tar.bz2 |
hdata: Make vpd data parsing function global
Move VPD parsing code to separate function (vpd_data_parse())
and make it as global. So that we can call this function from
other files.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hdata/hdata.h | 2 | ||||
-rw-r--r-- | hdata/vpd.c | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/hdata/hdata.h b/hdata/hdata.h index 6da9b55..cab0626 100644 --- a/hdata/hdata.h +++ b/hdata/hdata.h @@ -30,6 +30,8 @@ extern void io_parse(void); extern struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr, int indx_fru, int indx_vpd); extern void vpd_parse(void); +extern void vpd_data_parse(struct dt_node *node, + const void *fruvpd, u32 fruvpd_sz); extern struct dt_node *find_xscom_for_chip(uint32_t chip_id); extern uint32_t pcid_to_chip_id(uint32_t proc_chip_id); diff --git a/hdata/vpd.c b/hdata/vpd.c index 0e23e29..836869a 100644 --- a/hdata/vpd.c +++ b/hdata/vpd.c @@ -413,6 +413,14 @@ static struct dt_node *dt_create_vpd_node(struct dt_node *parent, return node; } +void vpd_data_parse(struct dt_node *node, const void *fruvpd, u32 fruvpd_sz) +{ + if (vpd_find_record(fruvpd, fruvpd_sz, "OPFR", NULL)) + vpd_opfr_parse(node, fruvpd, fruvpd_sz); + else + vpd_vini_parse(node, fruvpd, fruvpd_sz); +} + struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr, int indx_fru, int indx_vpd) { @@ -489,11 +497,7 @@ struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr, if (vpd_valid(fruvpd, fruvpd_sz) && !dt_find_property(node, "ibm,vpd")) { dt_add_property(node, "ibm,vpd", fruvpd, fruvpd_sz); - - if (vpd_find_record(fruvpd, fruvpd_sz, "OPFR", NULL)) - vpd_opfr_parse(node, fruvpd, fruvpd_sz); - else - vpd_vini_parse(node, fruvpd, fruvpd_sz); + vpd_data_parse(node, fruvpd, fruvpd_sz); } return node; |