diff options
Diffstat (limited to 'drivers/clk/clk-ar9344.c')
-rw-r--r-- | drivers/clk/clk-ar9344.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/drivers/clk/clk-ar9344.c b/drivers/clk/clk-ar9344.c index c3c49fb109..43a9da2857 100644 --- a/drivers/clk/clk-ar9344.c +++ b/drivers/clk/clk-ar9344.c @@ -1,14 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2017 Oleksij Rempel <linux@rempel-privat.de> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. */ #include <common.h> @@ -43,17 +35,17 @@ static struct clk *clks[ATH79_CLK_END]; static struct clk_onecell_data clk_data; struct clk_ar9344 { - struct clk clk; + struct clk_hw hw; void __iomem *base; u32 div_shift; u32 div_mask; const char *parent; }; -static unsigned long clk_ar9344_recalc_rate(struct clk *clk, +static unsigned long clk_ar9344_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { - struct clk_ar9344 *f = container_of(clk, struct clk_ar9344, clk); + struct clk_ar9344 *f = container_of(hw, struct clk_ar9344, hw); int outdiv, refdiv, nint, nfrac; int cpu_post_div; u32 clock_ctrl; @@ -92,14 +84,14 @@ static struct clk *clk_ar9344(const char *name, const char *parent, f->div_shift = 0; f->div_mask = 0; - f->clk.ops = &clk_ar9344_ops; - f->clk.name = name; - f->clk.parent_names = &f->parent; - f->clk.num_parents = 1; + f->hw.clk.ops = &clk_ar9344_ops; + f->hw.clk.name = name; + f->hw.clk.parent_names = &f->parent; + f->hw.clk.num_parents = 1; - clk_register(&f->clk); + bclk_register(&f->hw.clk); - return &f->clk; + return &f->hw.clk; } static void ar9344_pll_init(void __iomem *base) @@ -107,7 +99,7 @@ static void ar9344_pll_init(void __iomem *base) clks[ATH79_CLK_CPU] = clk_ar9344("cpu", "ref", base); } -static int ar9344_clk_probe(struct device_d *dev) +static int ar9344_clk_probe(struct device *dev) { struct resource *iores; void __iomem *base; @@ -121,7 +113,7 @@ static int ar9344_clk_probe(struct device_d *dev) clk_data.clks = clks; clk_data.clk_num = ARRAY_SIZE(clks); - of_clk_add_provider(dev->device_node, of_clk_src_onecell_get, + of_clk_add_provider(dev->of_node, of_clk_src_onecell_get, &clk_data); return 0; @@ -134,15 +126,12 @@ static __maybe_unused struct of_device_id ar9344_clk_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, ar9344_clk_dt_ids); -static struct driver_d ar9344_clk_driver = { +static struct driver ar9344_clk_driver = { .probe = ar9344_clk_probe, .name = "ar9344_clk", .of_compatible = DRV_OF_COMPAT(ar9344_clk_dt_ids), }; -static int ar9344_clk_init(void) -{ - return platform_driver_register(&ar9344_clk_driver); -} -postcore_initcall(ar9344_clk_init); +postcore_platform_driver(ar9344_clk_driver); |