From 267ef3179177cc345e5c1a550cd187a6e5cc8e69 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 11 Jan 2011 01:37:27 +0000 Subject: [pci] Allow pci_vpd_init() return status to be ignored Most xxx_init() functions are void functions with no failure cases. Allow pci_vpd_init() to be used in the same way. (Subsequent calls to pci_vpd_read() etc. will fail if pci_vpd_init() fails.) Signed-off-by: Michael Brown --- src/include/ipxe/pcivpd.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/include') diff --git a/src/include/ipxe/pcivpd.h b/src/include/ipxe/pcivpd.h index 8b973ea1c..469ec29f8 100644 --- a/src/include/ipxe/pcivpd.h +++ b/src/include/ipxe/pcivpd.h @@ -133,6 +133,17 @@ struct pci_vpd { struct pci_vpd_cache cache; }; +/** + * Check for presence of PCI VPD + * + * @v vpd PCI VPD + * @ret is_present VPD is present + */ +static inline __attribute__ (( always_inline )) int +pci_vpd_is_present ( struct pci_vpd *vpd ) { + return ( vpd->cap != 0 ); +} + /** * Check if PCI VPD read cache is valid * -- cgit v1.2.3-55-g7522