summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-03-09 12:55:34 +0530
committerSubrata Banik <subratabanik@google.com>2022-03-09 08:40:43 +0000
commit60b2ab8d1f280c84a8f4e870c5c81c3b4752d530 (patch)
tree2154df3b8451ca35c28da66c1e11a96a4f68bb3f
parent69cc557cfb6eb2cbb5b137bc206cd759c1dba5f0 (diff)
{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 <subratabanik@google.com> Change-Id: I3392f9c2cfb4a889a999c8ea25066c89979f0900 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62676 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
-rw-r--r--src/drivers/i2c/tpm/cr50.c4
-rw-r--r--src/drivers/spi/tpm/tpm.c4
-rw-r--r--src/drivers/tpm/cr50.c10
-rw-r--r--src/drivers/tpm/cr50.h4
-rw-r--r--src/security/tpm/tis.h4
5 files changed, 13 insertions, 13 deletions
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)
{