summaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-08-19 10:57:57 +0300
committerLinus Walleij <linus.walleij@linaro.org>2019-08-21 10:00:16 +0300
commit6e28aaab07c19fb97cedea9840ef796f1a772350 (patch)
tree146e25cafa9a5f3aa4feddb5e6dd146db7d26c4a /drivers/pinctrl
parenta4873accca0529b6a32e1ceb458be843cdea9ec6 (diff)
downloadlinux-6e28aaab07c19fb97cedea9840ef796f1a772350.tar.xz
pinctrl: rk805: Make structures constant
Static structures rk805_pinctrl_desc and rk805_gpio_chip, of types gpio_chip and pinctrl_desc respectively, are not used except to be copied into the fields of a different variable. Hence make rk805_pinctrl_desc and rk805_gpio_chip both constant to protect them from unintended modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190819075757.1753-1-nishkadg.linux@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-rk805.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-rk805.c b/drivers/pinctrl/pinctrl-rk805.c
index a8459cafd4ea..26adbe9d6d42 100644
--- a/drivers/pinctrl/pinctrl-rk805.c
+++ b/drivers/pinctrl/pinctrl-rk805.c
@@ -197,7 +197,7 @@ static int rk805_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
return !(val & pci->pin_cfg[offset].dir_msk);
}
-static struct gpio_chip rk805_gpio_chip = {
+static const struct gpio_chip rk805_gpio_chip = {
.label = "rk805-gpio",
.request = gpiochip_generic_request,
.free = gpiochip_generic_free,
@@ -404,7 +404,7 @@ static const struct pinconf_ops rk805_pinconf_ops = {
.pin_config_set = rk805_pinconf_set,
};
-static struct pinctrl_desc rk805_pinctrl_desc = {
+static const struct pinctrl_desc rk805_pinctrl_desc = {
.name = "rk805-pinctrl",
.pctlops = &rk805_pinctrl_ops,
.pmxops = &rk805_pinmux_ops,