Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: tegra: Constify peripheral clock registers

The peripheral clock registers are defined in static tables. These
tables never need to be modified at runtime, so they can reside in
read-only memory.

Signed-off-by: Thierry Reding <treding@nvidia.com>

+7 -7
+1 -1
drivers/clk/tegra/clk-periph-gate.c
··· 134 134 struct tegra_clk_periph_gate *gate; 135 135 struct clk *clk; 136 136 struct clk_init_data init; 137 - struct tegra_clk_periph_regs *pregs; 137 + const struct tegra_clk_periph_regs *pregs; 138 138 139 139 pregs = get_reg_bank(clk_num); 140 140 if (!pregs)
+1 -1
drivers/clk/tegra/clk-periph.c
··· 145 145 { 146 146 struct clk *clk; 147 147 struct clk_init_data init; 148 - struct tegra_clk_periph_regs *bank; 148 + const struct tegra_clk_periph_regs *bank; 149 149 bool div = !(periph->gate.flags & TEGRA_PERIPH_NO_DIV); 150 150 151 151 if (periph->gate.flags & TEGRA_PERIPH_NO_DIV) {
+1 -1
drivers/clk/tegra/clk-tegra-periph.c
··· 877 877 struct clk **dt_clk; 878 878 879 879 for (i = 0; i < ARRAY_SIZE(periph_clks); i++) { 880 - struct tegra_clk_periph_regs *bank; 880 + const struct tegra_clk_periph_regs *bank; 881 881 struct tegra_periph_init_data *data; 882 882 883 883 data = periph_clks + i;
+2 -2
drivers/clk/tegra/clk.c
··· 84 84 static int (*special_reset_deassert)(unsigned long); 85 85 static unsigned int num_special_reset; 86 86 87 - static struct tegra_clk_periph_regs periph_regs[] = { 87 + static const struct tegra_clk_periph_regs periph_regs[] = { 88 88 [0] = { 89 89 .enb_reg = CLK_OUT_ENB_L, 90 90 .enb_set_reg = CLK_OUT_ENB_SET_L, ··· 182 182 return -EINVAL; 183 183 } 184 184 185 - struct tegra_clk_periph_regs *get_reg_bank(int clkid) 185 + const struct tegra_clk_periph_regs *get_reg_bank(int clkid) 186 186 { 187 187 int reg_bank = clkid / 32; 188 188
+2 -2
drivers/clk/tegra/clk.h
··· 496 496 u8 flags; 497 497 int clk_num; 498 498 int *enable_refcnt; 499 - struct tegra_clk_periph_regs *regs; 499 + const struct tegra_clk_periph_regs *regs; 500 500 }; 501 501 502 502 #define to_clk_periph_gate(_hw) \ ··· 716 716 void tegra_init_dup_clks(struct tegra_clk_duplicate *dup_list, 717 717 struct clk *clks[], int clk_max); 718 718 719 - struct tegra_clk_periph_regs *get_reg_bank(int clkid); 719 + const struct tegra_clk_periph_regs *get_reg_bank(int clkid); 720 720 struct clk **tegra_clk_init(void __iomem *clk_base, int num, int periph_banks); 721 721 722 722 struct clk **tegra_lookup_dt_id(int clk_id, struct tegra_clk *tegra_clk);