Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83987?usp=email )
Change subject: soc/mediatek/common: Print error if GPIO raw_id is not in the range ......................................................................
soc/mediatek/common: Print error if GPIO raw_id is not in the range
TEST=build pass BUG=317009620
Change-Id: I5dffdb9f3e4e7e0d49209e6012893cd246948ee8 Signed-off-by: Jarried Lin jarried.lin@mediatek.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/83987 Reviewed-by: Yu-Ping Wu yupingso@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yidi Lin yidilin@google.com --- M src/soc/mediatek/common/gpio.c 1 file changed, 12 insertions(+), 4 deletions(-)
Approvals: Yidi Lin: Looks good to me, approved build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved
diff --git a/src/soc/mediatek/common/gpio.c b/src/soc/mediatek/common/gpio.c index bbfbb3d..3dfdf92 100644 --- a/src/soc/mediatek/common/gpio.c +++ b/src/soc/mediatek/common/gpio.c @@ -189,8 +189,10 @@ const struct gpio_drv_info *adv_info = get_gpio_driving_adv_info(gpio.id); void *reg, *reg_adv, *reg_addr;
- if (!info) + if (!info) { + printk(BIOS_ERR, "%s: raw_id %u is out of range\n", __func__, gpio.id); return -1; + }
if (!is_valid_drv(drv)) return -1; @@ -221,8 +223,10 @@ const struct gpio_drv_info *info = get_gpio_driving_info(gpio.id); void *reg;
- if (!info) + if (!info) { + printk(BIOS_ERR, "%s: raw_id %u is out of range\n", __func__, gpio.id); return -1; + }
if (info->width == 0) return -1; @@ -237,8 +241,10 @@ const struct gpio_drv_info *adv_info = get_gpio_driving_adv_info(gpio.id); void *reg_adv;
- if (!adv_info) + if (!adv_info) { + printk(BIOS_ERR, "%s: raw_id %u is out of range\n", __func__, gpio.id); return -1; + }
if (!is_valid_drv_adv(drv)) return -1; @@ -266,8 +272,10 @@ void *reg_adv; uint32_t drv;
- if (!adv_info) + if (!adv_info) { + printk(BIOS_ERR, "%s: raw_id %u is out of range\n", __func__, gpio.id); return -1; + }
if (adv_info->width == 0) return -1;