Skip to content

Commit

Permalink
pinctrl: move const qualifier before struct
Browse files Browse the repository at this point in the history
Update subsystem wide for consistency.

Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
masahir0y authored and linusw committed Aug 14, 2017
1 parent e84621b commit 3f713b7
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 54 deletions.
4 changes: 2 additions & 2 deletions drivers/pinctrl/berlin/berlin.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ static int berlin_pinctrl_add_function(struct berlin_pinctrl *pctrl,
static int berlin_pinctrl_build_state(struct platform_device *pdev)
{
struct berlin_pinctrl *pctrl = platform_get_drvdata(pdev);
struct berlin_desc_group const *desc_group;
struct berlin_desc_function const *desc_function;
const struct berlin_desc_group *desc_group;
const struct berlin_desc_function *desc_function;
int i, max_functions = 0;

pctrl->nfunctions = 0;
Expand Down
14 changes: 7 additions & 7 deletions drivers/pinctrl/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev,
}

static int pinctrl_register_pins(struct pinctrl_dev *pctldev,
struct pinctrl_pin_desc const *pins,
const struct pinctrl_pin_desc *pins,
unsigned num_descs)
{
unsigned i;
Expand Down Expand Up @@ -907,7 +907,7 @@ static struct pinctrl_state *create_state(struct pinctrl *p,
}

static int add_setting(struct pinctrl *p, struct pinctrl_dev *pctldev,
struct pinctrl_map const *map)
const struct pinctrl_map *map)
{
struct pinctrl_state *state;
struct pinctrl_setting *setting;
Expand Down Expand Up @@ -995,7 +995,7 @@ static struct pinctrl *create_pinctrl(struct device *dev,
const char *devname;
struct pinctrl_maps *maps_node;
int i;
struct pinctrl_map const *map;
const struct pinctrl_map *map;
int ret;

/*
Expand Down Expand Up @@ -1321,7 +1321,7 @@ void devm_pinctrl_put(struct pinctrl *p)
}
EXPORT_SYMBOL_GPL(devm_pinctrl_put);

int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
bool dup)
{
int i, ret;
Expand Down Expand Up @@ -1402,13 +1402,13 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
* function will perform a shallow copy for the mapping entries.
* @num_maps: the number of maps in the mapping table
*/
int pinctrl_register_mappings(struct pinctrl_map const *maps,
int pinctrl_register_mappings(const struct pinctrl_map *maps,
unsigned num_maps)
{
return pinctrl_register_map(maps, num_maps, true);
}

void pinctrl_unregister_map(struct pinctrl_map const *map)
void pinctrl_unregister_map(const struct pinctrl_map *map)
{
struct pinctrl_maps *maps_node;

Expand Down Expand Up @@ -1702,7 +1702,7 @@ static int pinctrl_maps_show(struct seq_file *s, void *what)
{
struct pinctrl_maps *maps_node;
int i;
struct pinctrl_map const *map;
const struct pinctrl_map *map;

seq_puts(s, "Pinctrl maps:\n");

Expand Down
6 changes: 3 additions & 3 deletions drivers/pinctrl/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ struct pin_desc {
*/
struct pinctrl_maps {
struct list_head node;
struct pinctrl_map const *maps;
const struct pinctrl_map *maps;
unsigned num_maps;
};

Expand Down Expand Up @@ -243,9 +243,9 @@ extern struct pinctrl_gpio_range *
pinctrl_find_gpio_range_from_pin_nolock(struct pinctrl_dev *pctldev,
unsigned int pin);

int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
bool dup);
void pinctrl_unregister_map(struct pinctrl_map const *map);
void pinctrl_unregister_map(const struct pinctrl_map *map);

extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev);
extern int pinctrl_force_default(struct pinctrl_dev *pctldev);
Expand Down
12 changes: 6 additions & 6 deletions drivers/pinctrl/pinconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int pinconf_check_ops(struct pinctrl_dev *pctldev)
return 0;
}

int pinconf_validate_map(struct pinctrl_map const *map, int i)
int pinconf_validate_map(const struct pinctrl_map *map, int i)
{
if (!map->data.configs.group_or_pin) {
pr_err("failed to register map %s (%d): no group/pin given\n",
Expand Down Expand Up @@ -106,7 +106,7 @@ int pin_config_group_get(const char *dev_name, const char *pin_group,
return ret;
}

int pinconf_map_to_setting(struct pinctrl_map const *map,
int pinconf_map_to_setting(const struct pinctrl_map *map,
struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
Expand Down Expand Up @@ -143,11 +143,11 @@ int pinconf_map_to_setting(struct pinctrl_map const *map,
return 0;
}

void pinconf_free_setting(struct pinctrl_setting const *setting)
void pinconf_free_setting(const struct pinctrl_setting *setting)
{
}

int pinconf_apply_setting(struct pinctrl_setting const *setting)
int pinconf_apply_setting(const struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
const struct pinconf_ops *ops = pctldev->desc->confops;
Expand Down Expand Up @@ -235,7 +235,7 @@ static void pinconf_show_config(struct seq_file *s, struct pinctrl_dev *pctldev,
}
}

void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map)
void pinconf_show_map(struct seq_file *s, const struct pinctrl_map *map)
{
struct pinctrl_dev *pctldev;

Expand All @@ -259,7 +259,7 @@ void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map)
}

void pinconf_show_setting(struct seq_file *s,
struct pinctrl_setting const *setting)
const struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
Expand Down
24 changes: 12 additions & 12 deletions drivers/pinctrl/pinconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#ifdef CONFIG_PINCONF

int pinconf_check_ops(struct pinctrl_dev *pctldev);
int pinconf_validate_map(struct pinctrl_map const *map, int i);
int pinconf_map_to_setting(struct pinctrl_map const *map,
int pinconf_validate_map(const struct pinctrl_map *map, int i);
int pinconf_map_to_setting(const struct pinctrl_map *map,
struct pinctrl_setting *setting);
void pinconf_free_setting(struct pinctrl_setting const *setting);
int pinconf_apply_setting(struct pinctrl_setting const *setting);
void pinconf_free_setting(const struct pinctrl_setting *setting);
int pinconf_apply_setting(const struct pinctrl_setting *setting);

int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
unsigned long *configs, size_t nconfigs);
Expand All @@ -39,22 +39,22 @@ static inline int pinconf_check_ops(struct pinctrl_dev *pctldev)
return 0;
}

static inline int pinconf_validate_map(struct pinctrl_map const *map, int i)
static inline int pinconf_validate_map(const struct pinctrl_map *map, int i)
{
return 0;
}

static inline int pinconf_map_to_setting(struct pinctrl_map const *map,
static inline int pinconf_map_to_setting(const struct pinctrl_map *map,
struct pinctrl_setting *setting)
{
return 0;
}

static inline void pinconf_free_setting(struct pinctrl_setting const *setting)
static inline void pinconf_free_setting(const struct pinctrl_setting *setting)
{
}

static inline int pinconf_apply_setting(struct pinctrl_setting const *setting)
static inline int pinconf_apply_setting(const struct pinctrl_setting *setting)
{
return 0;
}
Expand All @@ -69,21 +69,21 @@ static inline int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,

#if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS)

void pinconf_show_map(struct seq_file *s, struct pinctrl_map const *map);
void pinconf_show_map(struct seq_file *s, const struct pinctrl_map *map);
void pinconf_show_setting(struct seq_file *s,
struct pinctrl_setting const *setting);
const struct pinctrl_setting *setting);
void pinconf_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev);

#else

static inline void pinconf_show_map(struct seq_file *s,
struct pinctrl_map const *map)
const struct pinctrl_map *map)
{
}

static inline void pinconf_show_setting(struct seq_file *s,
struct pinctrl_setting const *setting)
const struct pinctrl_setting *setting)
{
}

Expand Down
14 changes: 7 additions & 7 deletions drivers/pinctrl/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int pinmux_check_ops(struct pinctrl_dev *pctldev)
return 0;
}

int pinmux_validate_map(struct pinctrl_map const *map, int i)
int pinmux_validate_map(const struct pinctrl_map *map, int i)
{
if (!map->data.mux.function) {
pr_err("failed to register map %s (%d): no function given\n",
Expand Down Expand Up @@ -312,7 +312,7 @@ static int pinmux_func_name_to_selector(struct pinctrl_dev *pctldev,
return -EINVAL;
}

int pinmux_map_to_setting(struct pinctrl_map const *map,
int pinmux_map_to_setting(const struct pinctrl_map *map,
struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
Expand Down Expand Up @@ -372,12 +372,12 @@ int pinmux_map_to_setting(struct pinctrl_map const *map,
return 0;
}

void pinmux_free_setting(struct pinctrl_setting const *setting)
void pinmux_free_setting(const struct pinctrl_setting *setting)
{
/* This function is currently unused */
}

int pinmux_enable_setting(struct pinctrl_setting const *setting)
int pinmux_enable_setting(const struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
Expand Down Expand Up @@ -458,7 +458,7 @@ int pinmux_enable_setting(struct pinctrl_setting const *setting)
return ret;
}

void pinmux_disable_setting(struct pinctrl_setting const *setting)
void pinmux_disable_setting(const struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
Expand Down Expand Up @@ -627,15 +627,15 @@ static int pinmux_pins_show(struct seq_file *s, void *what)
return 0;
}

void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map)
void pinmux_show_map(struct seq_file *s, const struct pinctrl_map *map)
{
seq_printf(s, "group %s\nfunction %s\n",
map->data.mux.group ? map->data.mux.group : "(default)",
map->data.mux.function);
}

void pinmux_show_setting(struct seq_file *s,
struct pinctrl_setting const *setting)
const struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
Expand Down
29 changes: 14 additions & 15 deletions drivers/pinctrl/pinmux.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

int pinmux_check_ops(struct pinctrl_dev *pctldev);

int pinmux_validate_map(struct pinctrl_map const *map, int i);
int pinmux_validate_map(const struct pinctrl_map *map, int i);

int pinmux_request_gpio(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
Expand All @@ -25,11 +25,11 @@ int pinmux_gpio_direction(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned pin, bool input);

int pinmux_map_to_setting(struct pinctrl_map const *map,
int pinmux_map_to_setting(const struct pinctrl_map *map,
struct pinctrl_setting *setting);
void pinmux_free_setting(struct pinctrl_setting const *setting);
int pinmux_enable_setting(struct pinctrl_setting const *setting);
void pinmux_disable_setting(struct pinctrl_setting const *setting);
void pinmux_free_setting(const struct pinctrl_setting *setting);
int pinmux_enable_setting(const struct pinctrl_setting *setting);
void pinmux_disable_setting(const struct pinctrl_setting *setting);

#else

Expand All @@ -38,7 +38,7 @@ static inline int pinmux_check_ops(struct pinctrl_dev *pctldev)
return 0;
}

static inline int pinmux_validate_map(struct pinctrl_map const *map, int i)
static inline int pinmux_validate_map(const struct pinctrl_map *map, int i)
{
return 0;
}
Expand All @@ -63,45 +63,44 @@ static inline int pinmux_gpio_direction(struct pinctrl_dev *pctldev,
return 0;
}

static inline int pinmux_map_to_setting(struct pinctrl_map const *map,
static inline int pinmux_map_to_setting(const struct pinctrl_map *map,
struct pinctrl_setting *setting)
{
return 0;
}

static inline void pinmux_free_setting(struct pinctrl_setting const *setting)
static inline void pinmux_free_setting(const struct pinctrl_setting *setting)
{
}

static inline int pinmux_enable_setting(struct pinctrl_setting const *setting)
static inline int pinmux_enable_setting(const struct pinctrl_setting *setting)
{
return 0;
}

static inline void pinmux_disable_setting(
struct pinctrl_setting const *setting)
static inline void pinmux_disable_setting(const struct pinctrl_setting *setting)
{
}

#endif

#if defined(CONFIG_PINMUX) && defined(CONFIG_DEBUG_FS)

void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map);
void pinmux_show_map(struct seq_file *s, const struct pinctrl_map *map);
void pinmux_show_setting(struct seq_file *s,
struct pinctrl_setting const *setting);
const struct pinctrl_setting *setting);
void pinmux_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev);

#else

static inline void pinmux_show_map(struct seq_file *s,
struct pinctrl_map const *map)
const struct pinctrl_map *map)
{
}

static inline void pinmux_show_setting(struct seq_file *s,
struct pinctrl_setting const *setting)
const struct pinctrl_setting *setting)
{
}

Expand Down
4 changes: 2 additions & 2 deletions include/linux/pinctrl/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ struct pinctrl_map {

#ifdef CONFIG_PINCTRL

extern int pinctrl_register_mappings(struct pinctrl_map const *map,
extern int pinctrl_register_mappings(const struct pinctrl_map *map,
unsigned num_maps);
extern void pinctrl_provide_dummies(void);
#else

static inline int pinctrl_register_mappings(struct pinctrl_map const *map,
static inline int pinctrl_register_mappings(const struct pinctrl_map *map,
unsigned num_maps)
{
return 0;
Expand Down

0 comments on commit 3f713b7

Please sign in to comment.