clk: mvebu: dynamically allocate resources in Armada CP110 system controller
authorMarcin Wojtas <mw@semihalf.com>
Wed, 21 Sep 2016 09:05:58 +0000 (11:05 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 22 Sep 2016 23:05:07 +0000 (16:05 -0700)
commita0245eb76ad0f652f1eb14f48ca2d3c4391aef66
tree6b271a6619b76230cc6c5e1de5eb167173e059b0
parentad715b268a501533ecb2e891a624841d1bb5137c
clk: mvebu: dynamically allocate resources in Armada CP110 system controller

Original commit, which added support for Armada CP110 system controller
used global variables for storing all clock information. It worked
fine for Armada 7k SoC, with single CP110 block. After dual-CP110 Armada 8k
was introduced, the data got overwritten and corrupted.

This patch fixes the issue by allocating resources dynamically in the
driver probe and storing it as platform drvdata.

Fixes: d3da3eaef7f4 ("clk: mvebu: new driver for Armada CP110 system ...")
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/mvebu/cp110-system-controller.c