Re: [PATCH 05/14] bus: ti-sysc: Add separate functions for handling clocks
From: Tony Lindgren
Date: Wed Apr 03 2019 - 14:01:03 EST
* Tony Lindgren <tony@xxxxxxxxxxx> [190325 22:00]:
> Let's also add error handling to shut down already enabled clocks
> while at it.
...
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> +err_disable:
> + for (; i >= 0; i--) {
> + clock = ddata->clocks[i];
> +
> + /* Main clocks may not have ick */
> + if (IS_ERR_OR_NULL(clock))
> + continue;
> +
> + clk_disable(clock);
> + }
> +
> + return error;
> +}
We need to ignore the current clock on error above
and use for (i--; i >= 0; i--) instead. The same for
sysc_enable_opt_clocks().
Updated patch below.
Regards,
Tony
8< --------------------