Skip to content

Commit 891b702

Browse files
neuschaeferbebarino
authored andcommitted
clk: mux: Declare u32 *table parameter as const
The elements of the table are never modified in clk-mux.c. To make this clear to clock drivers, declare the parameter as const u32 *table. Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Link: https://lore.kernel.org/r/20220205103613.1216218-4-j.neuschaefer@gmx.net Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 2eb3b3f commit 891b702

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

drivers/clk/clk-mux.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static inline void clk_mux_writel(struct clk_mux *mux, u32 val)
4040
writel(val, mux->reg);
4141
}
4242

43-
int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
43+
int clk_mux_val_to_index(struct clk_hw *hw, const u32 *table, unsigned int flags,
4444
unsigned int val)
4545
{
4646
int num_parents = clk_hw_get_num_parents(hw);
@@ -67,7 +67,7 @@ int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
6767
}
6868
EXPORT_SYMBOL_GPL(clk_mux_val_to_index);
6969

70-
unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index)
70+
unsigned int clk_mux_index_to_val(const u32 *table, unsigned int flags, u8 index)
7171
{
7272
unsigned int val = index;
7373

@@ -152,7 +152,7 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np,
152152
const struct clk_hw **parent_hws,
153153
const struct clk_parent_data *parent_data,
154154
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
155-
u8 clk_mux_flags, u32 *table, spinlock_t *lock)
155+
u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
156156
{
157157
struct clk_mux *mux;
158158
struct clk_hw *hw;
@@ -218,7 +218,7 @@ struct clk_hw *__devm_clk_hw_register_mux(struct device *dev, struct device_node
218218
const struct clk_hw **parent_hws,
219219
const struct clk_parent_data *parent_data,
220220
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
221-
u8 clk_mux_flags, u32 *table, spinlock_t *lock)
221+
u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
222222
{
223223
struct clk_hw **ptr, *hw;
224224

@@ -244,7 +244,7 @@ EXPORT_SYMBOL_GPL(__devm_clk_hw_register_mux);
244244
struct clk *clk_register_mux_table(struct device *dev, const char *name,
245245
const char * const *parent_names, u8 num_parents,
246246
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
247-
u8 clk_mux_flags, u32 *table, spinlock_t *lock)
247+
u8 clk_mux_flags, const u32 *table, spinlock_t *lock)
248248
{
249249
struct clk_hw *hw;
250250

include/linux/clk-provider.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ void clk_hw_unregister_divider(struct clk_hw *hw);
888888
struct clk_mux {
889889
struct clk_hw hw;
890890
void __iomem *reg;
891-
u32 *table;
891+
const u32 *table;
892892
u32 mask;
893893
u8 shift;
894894
u8 flags;
@@ -913,18 +913,18 @@ struct clk_hw *__clk_hw_register_mux(struct device *dev, struct device_node *np,
913913
const struct clk_hw **parent_hws,
914914
const struct clk_parent_data *parent_data,
915915
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
916-
u8 clk_mux_flags, u32 *table, spinlock_t *lock);
916+
u8 clk_mux_flags, const u32 *table, spinlock_t *lock);
917917
struct clk_hw *__devm_clk_hw_register_mux(struct device *dev, struct device_node *np,
918918
const char *name, u8 num_parents,
919919
const char * const *parent_names,
920920
const struct clk_hw **parent_hws,
921921
const struct clk_parent_data *parent_data,
922922
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
923-
u8 clk_mux_flags, u32 *table, spinlock_t *lock);
923+
u8 clk_mux_flags, const u32 *table, spinlock_t *lock);
924924
struct clk *clk_register_mux_table(struct device *dev, const char *name,
925925
const char * const *parent_names, u8 num_parents,
926926
unsigned long flags, void __iomem *reg, u8 shift, u32 mask,
927-
u8 clk_mux_flags, u32 *table, spinlock_t *lock);
927+
u8 clk_mux_flags, const u32 *table, spinlock_t *lock);
928928

929929
#define clk_register_mux(dev, name, parent_names, num_parents, flags, reg, \
930930
shift, width, clk_mux_flags, lock) \
@@ -962,9 +962,9 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
962962
(shift), BIT((width)) - 1, (clk_mux_flags), \
963963
NULL, (lock))
964964

965-
int clk_mux_val_to_index(struct clk_hw *hw, u32 *table, unsigned int flags,
965+
int clk_mux_val_to_index(struct clk_hw *hw, const u32 *table, unsigned int flags,
966966
unsigned int val);
967-
unsigned int clk_mux_index_to_val(u32 *table, unsigned int flags, u8 index);
967+
unsigned int clk_mux_index_to_val(const u32 *table, unsigned int flags, u8 index);
968968

969969
void clk_unregister_mux(struct clk *clk);
970970
void clk_hw_unregister_mux(struct clk_hw *hw);

0 commit comments

Comments
 (0)