From 60b2ab8d1f280c84a8f4e870c5c81c3b4752d530 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 9 Mar 2022 12:55:34 +0530 Subject: {drivers/security}: Replace `cb_err_t` with `enum cb_err` This patch replaces remaining `cb_err_t` with `enum cb_err` after commit hash 69cc557c (commonlib/bsd: Remove cb_err_t) removes majority of `cb_err_t` instances. TEST=Able to build the brya. Signed-off-by: Subrata Banik Change-Id: I3392f9c2cfb4a889a999c8ea25066c89979f0900 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62676 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh Reviewed-by: Eric Lai Reviewed-by: Arthur Heymans --- src/drivers/i2c/tpm/cr50.c | 4 ++-- src/drivers/spi/tpm/tpm.c | 4 ++-- src/drivers/tpm/cr50.c | 10 +++++----- src/drivers/tpm/cr50.h | 4 ++-- src/security/tpm/tis.h | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c index f8548a77da..ce2278b8c6 100644 --- a/src/drivers/i2c/tpm/cr50.c +++ b/src/drivers/i2c/tpm/cr50.c @@ -514,12 +514,12 @@ void tpm_vendor_cleanup(struct tpm_chip *chip) { } -cb_err_t tis_vendor_write(unsigned int addr, const void *buffer, size_t bytes) +enum cb_err tis_vendor_write(unsigned int addr, const void *buffer, size_t bytes) { return cr50_i2c_write(addr & 0xff, buffer, bytes) ? CB_ERR : CB_SUCCESS; } -cb_err_t tis_vendor_read(unsigned int addr, void *buffer, size_t bytes) +enum cb_err tis_vendor_read(unsigned int addr, void *buffer, size_t bytes) { return cr50_i2c_read(addr & 0xff, buffer, bytes) ? CB_ERR : CB_SUCCESS; } diff --git a/src/drivers/spi/tpm/tpm.c b/src/drivers/spi/tpm/tpm.c index 53b3a254c8..43fd933dbf 100644 --- a/src/drivers/spi/tpm/tpm.c +++ b/src/drivers/spi/tpm/tpm.c @@ -728,12 +728,12 @@ size_t tpm2_process_command(const void *tpm2_command, size_t command_size, return payload_size; } -cb_err_t tis_vendor_write(unsigned int addr, const void *buffer, size_t bytes) +enum cb_err tis_vendor_write(unsigned int addr, const void *buffer, size_t bytes) { return tpm2_write_reg(addr, buffer, bytes); } -cb_err_t tis_vendor_read(unsigned int addr, void *buffer, size_t bytes) +enum cb_err tis_vendor_read(unsigned int addr, void *buffer, size_t bytes) { return tpm2_read_reg(addr, buffer, bytes); } diff --git a/src/drivers/tpm/cr50.c b/src/drivers/tpm/cr50.c index 4b5e8134f2..f96e17450b 100644 --- a/src/drivers/tpm/cr50.c +++ b/src/drivers/tpm/cr50.c @@ -79,7 +79,7 @@ static uint32_t cr50_get_board_cfg(void) if (!cr50_fw_supports_board_cfg(&cr50_firmware_version)) return 0; - const cb_err_t ret = tis_vendor_read(get_reg_addr(CR50_BOARD_CFG_REG), &value, + const enum cb_err ret = tis_vendor_read(get_reg_addr(CR50_BOARD_CFG_REG), &value, sizeof(value)); if (ret != CB_SUCCESS) { printk(BIOS_INFO, "Error reading from cr50\n"); @@ -92,10 +92,10 @@ static uint32_t cr50_get_board_cfg(void) /** * Set the BOARD_CFG register on the TPM chip to a particular compile-time constant value. */ -cb_err_t cr50_set_board_cfg(void) +enum cb_err cr50_set_board_cfg(void) { uint32_t value; - cb_err_t ret; + enum cb_err ret; if (!cr50_fw_supports_board_cfg(&cr50_firmware_version)) return CB_ERR; @@ -139,7 +139,7 @@ bool cr50_is_long_interrupt_pulse_enabled(void) return !!(cr50_get_board_cfg() & CR50_BOARD_CFG_100US_READY_PULSE); } -static cb_err_t cr50_parse_fw_version(const char *version_str, +static enum cb_err cr50_parse_fw_version(const char *version_str, struct cr50_firmware_version *ver) { int epoch, major, minor; @@ -165,7 +165,7 @@ static cb_err_t cr50_parse_fw_version(const char *version_str, return CB_SUCCESS; } -cb_err_t cr50_get_firmware_version(struct cr50_firmware_version *version) +enum cb_err cr50_get_firmware_version(struct cr50_firmware_version *version) { if (cr50_firmware_version.epoch || cr50_firmware_version.major || cr50_firmware_version.minor) diff --git a/src/drivers/tpm/cr50.h b/src/drivers/tpm/cr50.h index 4fdd06b50b..f754e133b8 100644 --- a/src/drivers/tpm/cr50.h +++ b/src/drivers/tpm/cr50.h @@ -16,9 +16,9 @@ struct cr50_firmware_version { bool cr50_is_long_interrupt_pulse_enabled(void); /* Get the Cr50 firmware version information. */ -cb_err_t cr50_get_firmware_version(struct cr50_firmware_version *version); +enum cb_err cr50_get_firmware_version(struct cr50_firmware_version *version); /* Set the BOARD_CFG register depending on Cr50 Kconfigs */ -cb_err_t cr50_set_board_cfg(void); +enum cb_err cr50_set_board_cfg(void); #endif /* __DRIVERS_TPM_CR50_H__ */ diff --git a/src/security/tpm/tis.h b/src/security/tpm/tis.h index 0ef5a8a090..660ec81231 100644 --- a/src/security/tpm/tis.h +++ b/src/security/tpm/tis.h @@ -96,7 +96,7 @@ int tis_plat_irq_status(void); * * Returns CB_SUCCESS 0 on success, CB_ERR on failure. */ -cb_err_t tis_vendor_write(unsigned int addr, const void *sendbuf, size_t send_size); +enum cb_err tis_vendor_write(unsigned int addr, const void *sendbuf, size_t send_size); /* * tis_vendor_read() @@ -109,7 +109,7 @@ cb_err_t tis_vendor_write(unsigned int addr, const void *sendbuf, size_t send_si * * Returns CB_SUCCESS on success or -1 on failure. */ -cb_err_t tis_vendor_read(unsigned int addr, void *recvbuf, size_t recv_size); +enum cb_err tis_vendor_read(unsigned int addr, void *recvbuf, size_t recv_size); static inline bool tpm_first_access_this_boot(void) { -- cgit v1.2.3