{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>
This commit is contained in:
Subrata Banik 2022-03-09 12:55:34 +05:30
parent 69cc557cfb
commit 60b2ab8d1f
5 changed files with 13 additions and 13 deletions

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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)

View File

@ -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__ */

View File

@ -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)
{