forked from mirrors/linux
		
	clk: make strings in parent name arrays const
The clk functions and structs declare the parent_name arrays as 'const char **parent_names' which means the parent name strings are const, but the array itself is not. Use 'const char * const * parent_names' instead which also makes the array const. This allows us to put the parent_name arrays into the __initconst section. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [sboyd@codeaurora.org: Squelch 80-character checkpatch warnings] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
		
							parent
							
								
									396e339a77
								
							
						
					
					
						commit
						2893c37946
					
				
					 3 changed files with 11 additions and 7 deletions
				
			
		| 
						 | 
					@ -188,7 +188,7 @@ static void clk_composite_disable(struct clk_hw *hw)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct clk *clk_register_composite(struct device *dev, const char *name,
 | 
					struct clk *clk_register_composite(struct device *dev, const char *name,
 | 
				
			||||||
			const char **parent_names, int num_parents,
 | 
								const char * const *parent_names, int num_parents,
 | 
				
			||||||
			struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
 | 
								struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
 | 
				
			||||||
			struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
 | 
								struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
 | 
				
			||||||
			struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
 | 
								struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -114,7 +114,8 @@ const struct clk_ops clk_mux_ro_ops = {
 | 
				
			||||||
EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
 | 
					EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct clk *clk_register_mux_table(struct device *dev, const char *name,
 | 
					struct clk *clk_register_mux_table(struct device *dev, const char *name,
 | 
				
			||||||
		const char **parent_names, u8 num_parents, unsigned long flags,
 | 
							const char * const *parent_names, u8 num_parents,
 | 
				
			||||||
 | 
							unsigned long flags,
 | 
				
			||||||
		void __iomem *reg, u8 shift, u32 mask,
 | 
							void __iomem *reg, u8 shift, u32 mask,
 | 
				
			||||||
		u8 clk_mux_flags, u32 *table, spinlock_t *lock)
 | 
							u8 clk_mux_flags, u32 *table, spinlock_t *lock)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -166,7 +167,8 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
 | 
				
			||||||
EXPORT_SYMBOL_GPL(clk_register_mux_table);
 | 
					EXPORT_SYMBOL_GPL(clk_register_mux_table);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct clk *clk_register_mux(struct device *dev, const char *name,
 | 
					struct clk *clk_register_mux(struct device *dev, const char *name,
 | 
				
			||||||
		const char **parent_names, u8 num_parents, unsigned long flags,
 | 
							const char * const *parent_names, u8 num_parents,
 | 
				
			||||||
 | 
							unsigned long flags,
 | 
				
			||||||
		void __iomem *reg, u8 shift, u8 width,
 | 
							void __iomem *reg, u8 shift, u8 width,
 | 
				
			||||||
		u8 clk_mux_flags, spinlock_t *lock)
 | 
							u8 clk_mux_flags, spinlock_t *lock)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -209,7 +209,7 @@ struct clk_ops {
 | 
				
			||||||
struct clk_init_data {
 | 
					struct clk_init_data {
 | 
				
			||||||
	const char		*name;
 | 
						const char		*name;
 | 
				
			||||||
	const struct clk_ops	*ops;
 | 
						const struct clk_ops	*ops;
 | 
				
			||||||
	const char		**parent_names;
 | 
						const char		* const *parent_names;
 | 
				
			||||||
	u8			num_parents;
 | 
						u8			num_parents;
 | 
				
			||||||
	unsigned long		flags;
 | 
						unsigned long		flags;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -426,12 +426,14 @@ extern const struct clk_ops clk_mux_ops;
 | 
				
			||||||
extern const struct clk_ops clk_mux_ro_ops;
 | 
					extern const struct clk_ops clk_mux_ro_ops;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct clk *clk_register_mux(struct device *dev, const char *name,
 | 
					struct clk *clk_register_mux(struct device *dev, const char *name,
 | 
				
			||||||
		const char **parent_names, u8 num_parents, unsigned long flags,
 | 
							const char * const *parent_names, u8 num_parents,
 | 
				
			||||||
 | 
							unsigned long flags,
 | 
				
			||||||
		void __iomem *reg, u8 shift, u8 width,
 | 
							void __iomem *reg, u8 shift, u8 width,
 | 
				
			||||||
		u8 clk_mux_flags, spinlock_t *lock);
 | 
							u8 clk_mux_flags, spinlock_t *lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct clk *clk_register_mux_table(struct device *dev, const char *name,
 | 
					struct clk *clk_register_mux_table(struct device *dev, const char *name,
 | 
				
			||||||
		const char **parent_names, u8 num_parents, unsigned long flags,
 | 
							const char * const *parent_names, u8 num_parents,
 | 
				
			||||||
 | 
							unsigned long flags,
 | 
				
			||||||
		void __iomem *reg, u8 shift, u32 mask,
 | 
							void __iomem *reg, u8 shift, u32 mask,
 | 
				
			||||||
		u8 clk_mux_flags, u32 *table, spinlock_t *lock);
 | 
							u8 clk_mux_flags, u32 *table, spinlock_t *lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -518,7 +520,7 @@ struct clk_composite {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct clk *clk_register_composite(struct device *dev, const char *name,
 | 
					struct clk *clk_register_composite(struct device *dev, const char *name,
 | 
				
			||||||
		const char **parent_names, int num_parents,
 | 
							const char * const *parent_names, int num_parents,
 | 
				
			||||||
		struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
 | 
							struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
 | 
				
			||||||
		struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
 | 
							struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
 | 
				
			||||||
		struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
 | 
							struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue