[PATCH] i2c: geni: bail when clocks can't be enabled

Neil Armstrong neil.armstrong at linaro.org
Fri Jan 9 09:06:31 CET 2026


On 1/8/26 20:52, Casey Connolly via groups.io wrote:
> Failing to enable clocks will lead to bus hangs and the board crashing
> in some cases, let's actually deal with this error and fail probe rather than hoping the clocks are already enabled.
> 
> Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
> ---
>   drivers/i2c/geni_i2c.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/geni_i2c.c b/drivers/i2c/geni_i2c.c
> index d29e00fdf41d..fbe5ab0ad0c6 100644
> --- a/drivers/i2c/geni_i2c.c
> +++ b/drivers/i2c/geni_i2c.c
> @@ -493,9 +493,11 @@ static int geni_i2c_probe(struct udevice *dev)
>   		dev_err(dev, "clk_get_by_name(se) failed: %d\n", ret);
>   		return ret;
>   	}
>   
> -	geni_i2c_enable_clocks(dev, geni);
> +	ret = geni_i2c_enable_clocks(dev, geni);
> +	if (ret)
> +		return ret;
>   
>   	proto = readl(geni->base + GENI_FW_REVISION_RO);
>   	proto &= FW_REV_PROTOCOL_MSK;
>   	proto >>= FW_REV_PROTOCOL_SHFT;

Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>

Thanks,
Neil


More information about the U-Boot mailing list