diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2024-07-17 12:22:43 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-08-11 17:10:08 +0000 |
commit | 96719adda3f5e96cc5af537f3d9c70ae75073b46 (patch) | |
tree | 6fc7ab1279509dae46eca94cbe38c62d3dc1d24b /src/device/azalia_device.c | |
parent | af0d4bce65df277b56e495892dff1c712ed76ddd (diff) |
azalia: Get rid of "return {-1,0}
Use 'enum cb_err' instead of {-1,0}.
Change-Id: Icea33ea3e6a5e3c7bbfedc29045026cd722ac23e
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83503
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Diffstat (limited to 'src/device/azalia_device.c')
-rw-r--r-- | src/device/azalia_device.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index 4eed48906c..c167373764 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -9,7 +9,7 @@ #include <timer.h> #include <types.h> -int azalia_set_bits(void *port, u32 mask, u32 val) +static enum cb_err azalia_set_bits(void *port, u32 mask, u32 val) { struct stopwatch sw; u32 reg32; @@ -32,17 +32,17 @@ int azalia_set_bits(void *port, u32 mask, u32 val) /* Timeout occurred */ if (stopwatch_expired(&sw)) - return -1; - return 0; + return CB_ERR; + return CB_SUCCESS; } -int azalia_enter_reset(u8 *base) +enum cb_err azalia_enter_reset(u8 *base) { /* Set bit 0 to 0 to enter reset state (BAR + 0x8)[0] */ return azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0); } -int azalia_exit_reset(u8 *base) +enum cb_err azalia_exit_reset(u8 *base) { /* Set bit 0 to 1 to exit reset state (BAR + 0x8)[0] */ return azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, HDA_GCTL_CRST); @@ -53,7 +53,7 @@ static u16 codec_detect(u8 *base) struct stopwatch sw; u16 reg16; - if (azalia_exit_reset(base) < 0) + if (azalia_exit_reset(base) != CB_SUCCESS) goto no_codec; /* @@ -89,10 +89,10 @@ static u16 codec_detect(u8 *base) if (stopwatch_expired(&sw)) goto no_codec; - if (azalia_enter_reset(base) < 0) + if (azalia_enter_reset(base) != CB_SUCCESS) goto no_codec; - if (azalia_exit_reset(base) < 0) + if (azalia_exit_reset(base) != CB_SUCCESS) goto no_codec; /* Read in Codec location (BAR + 0x0e)[14:0] */ |