pinctrl: bcm: Constify static pinctrl_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sat, 5 Jun 2021 18:59:07 +0000 (20:59 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 9 Jun 2021 09:18:33 +0000 (11:18 +0200)
These are only assigned, either directly or via the bcm63xx_pinctrl_soc
struct, to the pctlops field in the pinctrl_desc struct and never
modified, so make them const to allow the compiler to put them in
read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20210605185908.39982-2-rikard.falkeborn@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-bcm6318.c
drivers/pinctrl/bcm/pinctrl-bcm63268.c
drivers/pinctrl/bcm/pinctrl-bcm6328.c
drivers/pinctrl/bcm/pinctrl-bcm6358.c
drivers/pinctrl/bcm/pinctrl-bcm6362.c
drivers/pinctrl/bcm/pinctrl-bcm6368.c
drivers/pinctrl/bcm/pinctrl-bcm63xx.h

index 77fd9b58067d2242c8906454ac2f0e44072f164e..4f96a285c3070dc5e440fb2837582c1a108c71cc 100644 (file)
@@ -452,7 +452,7 @@ static int bcm6318_gpio_request_enable(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static struct pinctrl_ops bcm6318_pctl_ops = {
+static const struct pinctrl_ops bcm6318_pctl_ops = {
        .dt_free_map = pinctrl_utils_free_map,
        .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
        .get_group_name = bcm6318_pinctrl_get_group_name,
index d4c5fad7fb7de4fae15e1c70e5dad975d5a47765..f1dea4e1c63e45ce7627b0cfc3fd48e86a0e9e56 100644 (file)
@@ -597,7 +597,7 @@ static int bcm63268_gpio_request_enable(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static struct pinctrl_ops bcm63268_pctl_ops = {
+static const struct pinctrl_ops bcm63268_pctl_ops = {
        .dt_free_map = pinctrl_utils_free_map,
        .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
        .get_group_name = bcm63268_pinctrl_get_group_name,
index c9efce6005502e476732a6a9815d9b3b4aa34171..fc090a1609d154a3801b254143e3a69dda85538b 100644 (file)
@@ -358,7 +358,7 @@ static int bcm6328_gpio_request_enable(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static struct pinctrl_ops bcm6328_pctl_ops = {
+static const struct pinctrl_ops bcm6328_pctl_ops = {
        .dt_free_map = pinctrl_utils_free_map,
        .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
        .get_group_name = bcm6328_pinctrl_get_group_name,
index d638578727f3090f4cdc9fa119da74299cd4a68a..7b316305eada3f4845408238b96307271b1fd0f9 100644 (file)
@@ -303,7 +303,7 @@ static int bcm6358_gpio_request_enable(struct pinctrl_dev *pctldev,
        return regmap_field_update_bits(priv->overlays, mask, 0);
 }
 
-static struct pinctrl_ops bcm6358_pctl_ops = {
+static const struct pinctrl_ops bcm6358_pctl_ops = {
        .dt_free_map = pinctrl_utils_free_map,
        .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
        .get_group_name = bcm6358_pinctrl_get_group_name,
index 40ef495b6301409195d5351c3a8b2fadb665c0a8..a9e8178268edb8946933e9efd69699de43b44a2f 100644 (file)
@@ -571,7 +571,7 @@ static int bcm6362_gpio_request_enable(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static struct pinctrl_ops bcm6362_pctl_ops = {
+static const struct pinctrl_ops bcm6362_pctl_ops = {
        .dt_free_map = pinctrl_utils_free_map,
        .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
        .get_group_name = bcm6362_pinctrl_get_group_name,
index 838095f9e8908ee771a2815b77caa44eb8c5bcf7..e3739e921f5c360d198c5fd93c70143501d790aa 100644 (file)
@@ -457,7 +457,7 @@ static int bcm6368_gpio_request_enable(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static struct pinctrl_ops bcm6368_pctl_ops = {
+static const struct pinctrl_ops bcm6368_pctl_ops = {
        .dt_free_map = pinctrl_utils_free_map,
        .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
        .get_group_name = bcm6368_pinctrl_get_group_name,
index 3bdb50021f1b0023e54ee56d2cd126c8d65e5e3a..c135477ec768c8f6224104d3c9bc004ddb3247f0 100644 (file)
@@ -12,7 +12,7 @@
 #define BCM63XX_BANK_GPIOS 32
 
 struct bcm63xx_pinctrl_soc {
-       struct pinctrl_ops *pctl_ops;
+       const struct pinctrl_ops *pctl_ops;
        struct pinmux_ops *pmx_ops;
 
        const struct pinctrl_pin_desc *pins;