| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * drivers/clk/at91/clk-slow.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2013 Boris BREZILLON <b.brezillon@overkiz.com> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | 6 | */ |
|---|
| 12 | 7 | |
|---|
| 13 | 8 | #include <linux/clk-provider.h> |
|---|
| .. | .. |
|---|
| 40 | 35 | .get_parent = clk_sam9260_slow_get_parent, |
|---|
| 41 | 36 | }; |
|---|
| 42 | 37 | |
|---|
| 43 | | -static struct clk_hw * __init |
|---|
| 38 | +struct clk_hw * __init |
|---|
| 44 | 39 | at91_clk_register_sam9260_slow(struct regmap *regmap, |
|---|
| 45 | 40 | const char *name, |
|---|
| 46 | 41 | const char **parent_names, |
|---|
| .. | .. |
|---|
| 48 | 43 | { |
|---|
| 49 | 44 | struct clk_sam9260_slow *slowck; |
|---|
| 50 | 45 | struct clk_hw *hw; |
|---|
| 51 | | - struct clk_init_data init = {}; |
|---|
| 46 | + struct clk_init_data init; |
|---|
| 52 | 47 | int ret; |
|---|
| 53 | 48 | |
|---|
| 54 | 49 | if (!name) |
|---|
| .. | .. |
|---|
| 79 | 74 | |
|---|
| 80 | 75 | return hw; |
|---|
| 81 | 76 | } |
|---|
| 82 | | - |
|---|
| 83 | | -static void __init of_at91sam9260_clk_slow_setup(struct device_node *np) |
|---|
| 84 | | -{ |
|---|
| 85 | | - struct clk_hw *hw; |
|---|
| 86 | | - const char *parent_names[2]; |
|---|
| 87 | | - unsigned int num_parents; |
|---|
| 88 | | - const char *name = np->name; |
|---|
| 89 | | - struct regmap *regmap; |
|---|
| 90 | | - |
|---|
| 91 | | - num_parents = of_clk_get_parent_count(np); |
|---|
| 92 | | - if (num_parents != 2) |
|---|
| 93 | | - return; |
|---|
| 94 | | - |
|---|
| 95 | | - of_clk_parent_fill(np, parent_names, num_parents); |
|---|
| 96 | | - regmap = syscon_node_to_regmap(of_get_parent(np)); |
|---|
| 97 | | - if (IS_ERR(regmap)) |
|---|
| 98 | | - return; |
|---|
| 99 | | - |
|---|
| 100 | | - of_property_read_string(np, "clock-output-names", &name); |
|---|
| 101 | | - |
|---|
| 102 | | - hw = at91_clk_register_sam9260_slow(regmap, name, parent_names, |
|---|
| 103 | | - num_parents); |
|---|
| 104 | | - if (IS_ERR(hw)) |
|---|
| 105 | | - return; |
|---|
| 106 | | - |
|---|
| 107 | | - of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw); |
|---|
| 108 | | -} |
|---|
| 109 | | - |
|---|
| 110 | | -CLK_OF_DECLARE(at91sam9260_clk_slow, "atmel,at91sam9260-clk-slow", |
|---|
| 111 | | - of_at91sam9260_clk_slow_setup); |
|---|