forked from Mirrors/opensbi
		
	lib: utils/regmap: Constify FDT pointers in parsing functions
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
		
				
					committed by
					
						
						Anup Patel
					
				
			
			
				
	
			
			
			
						parent
						
							7df1c8126f
						
					
				
				
					commit
					1bbda9b26f
				
			@@ -17,15 +17,15 @@ struct fdt_phandle_args;
 | 
			
		||||
/** FDT based regmap driver */
 | 
			
		||||
struct fdt_regmap {
 | 
			
		||||
	const struct fdt_match *match_table;
 | 
			
		||||
	int (*init)(void *fdt, int nodeoff, u32 phandle,
 | 
			
		||||
	int (*init)(const void *fdt, int nodeoff, u32 phandle,
 | 
			
		||||
		    const struct fdt_match *match);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/** Get regmap instance based on phandle */
 | 
			
		||||
int fdt_regmap_get_by_phandle(void *fdt, u32 phandle,
 | 
			
		||||
int fdt_regmap_get_by_phandle(const void *fdt, u32 phandle,
 | 
			
		||||
			      struct regmap **out_rmap);
 | 
			
		||||
 | 
			
		||||
/** Get regmap instance based on "regmap" property of the specified DT node */
 | 
			
		||||
int fdt_regmap_get(void *fdt, int nodeoff, struct regmap **out_rmap);
 | 
			
		||||
int fdt_regmap_get(const void *fdt, int nodeoff, struct regmap **out_rmap);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
extern struct fdt_regmap *fdt_regmap_drivers[];
 | 
			
		||||
extern unsigned long fdt_regmap_drivers_size;
 | 
			
		||||
 | 
			
		||||
static int fdt_regmap_init(void *fdt, int nodeoff, u32 phandle)
 | 
			
		||||
static int fdt_regmap_init(const void *fdt, int nodeoff, u32 phandle)
 | 
			
		||||
{
 | 
			
		||||
	int pos, rc;
 | 
			
		||||
	struct fdt_regmap *drv;
 | 
			
		||||
@@ -39,7 +39,7 @@ static int fdt_regmap_init(void *fdt, int nodeoff, u32 phandle)
 | 
			
		||||
	return SBI_ENOSYS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int fdt_regmap_find(void *fdt, int nodeoff, u32 phandle,
 | 
			
		||||
static int fdt_regmap_find(const void *fdt, int nodeoff, u32 phandle,
 | 
			
		||||
			   struct regmap **out_rmap)
 | 
			
		||||
{
 | 
			
		||||
	int rc;
 | 
			
		||||
@@ -63,7 +63,7 @@ static int fdt_regmap_find(void *fdt, int nodeoff, u32 phandle,
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int fdt_regmap_get_by_phandle(void *fdt, u32 phandle,
 | 
			
		||||
int fdt_regmap_get_by_phandle(const void *fdt, u32 phandle,
 | 
			
		||||
			      struct regmap **out_rmap)
 | 
			
		||||
{
 | 
			
		||||
	int pnodeoff;
 | 
			
		||||
@@ -78,7 +78,7 @@ int fdt_regmap_get_by_phandle(void *fdt, u32 phandle,
 | 
			
		||||
	return fdt_regmap_find(fdt, pnodeoff, phandle, out_rmap);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int fdt_regmap_get(void *fdt, int nodeoff, struct regmap **out_rmap)
 | 
			
		||||
int fdt_regmap_get(const void *fdt, int nodeoff, struct regmap **out_rmap)
 | 
			
		||||
{
 | 
			
		||||
	int len;
 | 
			
		||||
	const fdt32_t *val;
 | 
			
		||||
 
 | 
			
		||||
@@ -159,7 +159,7 @@ static int regmap_syscon_write_be32(struct regmap *rmap, unsigned int reg,
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int regmap_syscon_init(void *fdt, int nodeoff, u32 phandle,
 | 
			
		||||
static int regmap_syscon_init(const void *fdt, int nodeoff, u32 phandle,
 | 
			
		||||
			      const struct fdt_match *match)
 | 
			
		||||
{
 | 
			
		||||
	struct syscon_regmap *srm;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user