diff options
Diffstat (limited to 'drivers/clk/bcm/clk-bcm2835-aux.c')
-rw-r--r-- | drivers/clk/bcm/clk-bcm2835-aux.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c b/drivers/clk/bcm/clk-bcm2835-aux.c index 3a177ade6e6c..bd750cf2238d 100644 --- a/drivers/clk/bcm/clk-bcm2835-aux.c +++ b/drivers/clk/bcm/clk-bcm2835-aux.c @@ -25,7 +25,7 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct clk_onecell_data *onecell; + struct clk_hw_onecell_data *onecell; const char *parent; struct clk *parent_clk; struct resource *res; @@ -41,28 +41,24 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev) if (IS_ERR(reg)) return PTR_ERR(reg); - onecell = devm_kmalloc(dev, sizeof(*onecell), GFP_KERNEL); + onecell = devm_kmalloc(dev, sizeof(*onecell) + sizeof(*onecell->hws) * + BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); if (!onecell) return -ENOMEM; - onecell->clk_num = BCM2835_AUX_CLOCK_COUNT; - onecell->clks = devm_kcalloc(dev, BCM2835_AUX_CLOCK_COUNT, - sizeof(*onecell->clks), GFP_KERNEL); - if (!onecell->clks) - return -ENOMEM; + onecell->num = BCM2835_AUX_CLOCK_COUNT; gate = reg + BCM2835_AUXENB; - onecell->clks[BCM2835_AUX_CLOCK_UART] = - clk_register_gate(dev, "aux_uart", parent, 0, gate, 0, 0, NULL); - - onecell->clks[BCM2835_AUX_CLOCK_SPI1] = - clk_register_gate(dev, "aux_spi1", parent, 0, gate, 1, 0, NULL); + onecell->hws[BCM2835_AUX_CLOCK_UART] = + clk_hw_register_gate(dev, "aux_uart", parent, 0, gate, 0, 0, NULL); - onecell->clks[BCM2835_AUX_CLOCK_SPI2] = - clk_register_gate(dev, "aux_spi2", parent, 0, gate, 2, 0, NULL); + onecell->hws[BCM2835_AUX_CLOCK_SPI1] = + clk_hw_register_gate(dev, "aux_spi1", parent, 0, gate, 1, 0, NULL); - of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get, onecell); + onecell->hws[BCM2835_AUX_CLOCK_SPI2] = + clk_hw_register_gate(dev, "aux_spi2", parent, 0, gate, 2, 0, NULL); - return 0; + return of_clk_add_hw_provider(pdev->dev.of_node, of_clk_hw_onecell_get, + onecell); } static const struct of_device_id bcm2835_aux_clk_of_match[] = { |