clk: bcm63xx-gate: fix last clock availability
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Tue, 9 Jun 2020 11:08:46 +0000 (13:08 +0200)
committerStephen Boyd <sboyd@kernel.org>
Sat, 20 Jun 2020 00:01:25 +0000 (17:01 -0700)
In order to make the last clock available, maxbit has to be set to the
highest bit value plus 1.

Fixes: 1c099779c1e2 ("clk: add BCM63XX gated clock controller driver")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Link: https://lore.kernel.org/r/20200609110846.4029620-1-noltari@gmail.com
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/bcm/clk-bcm63xx-gate.c

index 98e884957db871a867422f9cadae90603cb8926c..911a29bd744efddc4b3294c06f52db0508c8e0dc 100644 (file)
@@ -155,6 +155,7 @@ static int clk_bcm63xx_probe(struct platform_device *pdev)
 
        for (entry = table; entry->name; entry++)
                maxbit = max_t(u8, maxbit, entry->bit);
+       maxbit++;
 
        hw = devm_kzalloc(&pdev->dev, struct_size(hw, data.hws, maxbit),
                          GFP_KERNEL);