From c97c8620833e4a55ddb7a43961d3205184a487f0 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Fri, 18 May 2018 07:54:44 -0700 Subject: bus: ti-sysc: Fix optional clocks array access We should be checking ddata->clocks[i] instead of clock_names[i] for the optional clocks. Currently this just happens to work for the typical case of one fck and one optional clock. Fixes: 09dfe5810762 ("bus: ti-sysc: Add handling for clkctrl opt clocks") Cc: Dan Carpenter Reported-by: Dan Carpenter Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/bus') diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 9cd8cd8c436e..1cc29629d238 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -128,7 +128,7 @@ static int sysc_get_one_clock(struct sysc *ddata, const char *name) if (index < 0) { for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) { - if (!clock_names[i]) { + if (!ddata->clocks[i]) { index = i; break; } -- cgit v1.2.3