]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pinctrl: mvebu: constify mvebu_mpp_ctrl structures
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 13 Jan 2017 11:03:15 +0000 (11:03 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 18 Jan 2017 08:53:25 +0000 (09:53 +0100)
As the mvebu_mpp_ctrl structures contain function pointers, it is
preferable for these to be made read-only to prevent the function
pointers being modified.  So make these const.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mvebu/pinctrl-armada-370.c
drivers/pinctrl/mvebu/pinctrl-armada-375.c
drivers/pinctrl/mvebu/pinctrl-armada-38x.c
drivers/pinctrl/mvebu/pinctrl-armada-39x.c
drivers/pinctrl/mvebu/pinctrl-armada-xp.c
drivers/pinctrl/mvebu/pinctrl-dove.c
drivers/pinctrl/mvebu/pinctrl-kirkwood.c
drivers/pinctrl/mvebu/pinctrl-mvebu.c
drivers/pinctrl/mvebu/pinctrl-mvebu.h
drivers/pinctrl/mvebu/pinctrl-orion.c

index 9cc1cc3f5c347d470d88cdf1d69d83fa2f4b736f..3cb6b4ea0118a427dea4ef06fb48dfae59189a84 100644 (file)
@@ -384,7 +384,7 @@ static const struct of_device_id armada_370_pinctrl_of_match[] = {
        { },
 };
 
-static struct mvebu_mpp_ctrl mv88f6710_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv88f6710_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 65, NULL, armada_370_mpp_ctrl),
 };
 
index 070651431ca4eea719bfa524d645fc1813210200..c9dba08780c57da4a15a6ee19b7ace13dd11abfb 100644 (file)
@@ -402,7 +402,7 @@ static const struct of_device_id armada_375_pinctrl_of_match[] = {
        { },
 };
 
-static struct mvebu_mpp_ctrl mv88f6720_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv88f6720_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 69, NULL, armada_375_mpp_ctrl),
 };
 
index 4e84c8e4938c52970d83cd7a5ec6a016f326297d..52f2ab82901a003af37830d3be3853bc90b4b376 100644 (file)
@@ -409,7 +409,7 @@ static const struct of_device_id armada_38x_pinctrl_of_match[] = {
        { },
 };
 
-static struct mvebu_mpp_ctrl armada_38x_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl armada_38x_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 59, NULL, armada_38x_mpp_ctrl),
 };
 
index e288f8ba0bf13cb9ebdf8d6a3a0c60155390a6f4..8ebc28ac289eb0371cb0d54881f225656a888a5b 100644 (file)
@@ -391,7 +391,7 @@ static const struct of_device_id armada_39x_pinctrl_of_match[] = {
        { },
 };
 
-static struct mvebu_mpp_ctrl armada_39x_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl armada_39x_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 59, NULL, armada_39x_mpp_ctrl),
 };
 
index e4ea71a9d98546d3a24f5ee28309474b79fccebd..cec3fef6f77fa87f673f79b84a047f993669c604 100644 (file)
@@ -378,7 +378,7 @@ static const struct of_device_id armada_xp_pinctrl_of_match[] = {
        { },
 };
 
-static struct mvebu_mpp_ctrl mv78230_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv78230_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 48, NULL, armada_xp_mpp_ctrl),
 };
 
@@ -387,7 +387,7 @@ static struct pinctrl_gpio_range mv78230_mpp_gpio_ranges[] = {
        MPP_GPIO_RANGE(1,  32, 32, 17),
 };
 
-static struct mvebu_mpp_ctrl mv78260_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv78260_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 66, NULL, armada_xp_mpp_ctrl),
 };
 
@@ -397,7 +397,7 @@ static struct pinctrl_gpio_range mv78260_mpp_gpio_ranges[] = {
        MPP_GPIO_RANGE(2,  64, 64,  3),
 };
 
-static struct mvebu_mpp_ctrl mv78460_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv78460_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 66, NULL, armada_xp_mpp_ctrl),
 };
 
index f93ae0dcef9caabdfdeb5635401f233c2b108bb3..745421496f6b88488b9d7482de507a7b0aa484d4 100644 (file)
@@ -354,7 +354,7 @@ static int dove_twsi_ctrl_set(unsigned pid, unsigned long config)
        return 0;
 }
 
-static struct mvebu_mpp_ctrl dove_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl dove_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 15, NULL, dove_pmu_mpp_ctrl),
        MPP_FUNC_CTRL(16, 23, NULL, dove_mpp_ctrl),
        MPP_FUNC_CTRL(24, 39, "mpp_camera", dove_mpp4_ctrl),
index 5f89c26f3292c87c094922a314a45452478c17e5..a331bb13a984e7d42e6a6c195392d97e274b8a4c 100644 (file)
@@ -370,7 +370,7 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
                MPP_VAR_FUNCTION(0xb, "lcd", "d17",      V(0, 0, 0, 0, 1, 0))),
 };
 
-static struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 44, NULL, kirkwood_mpp_ctrl),
 };
 
@@ -379,7 +379,7 @@ static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
        MPP_GPIO_RANGE(1, 35, 35, 10),
 };
 
-static struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 35, NULL, kirkwood_mpp_ctrl),
 };
 
@@ -388,7 +388,7 @@ static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
        MPP_GPIO_RANGE(1, 32, 32,  4),
 };
 
-static struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 49, NULL, kirkwood_mpp_ctrl),
 };
 
index ff314aa823e72e025a478a30a4625bd39cda5b8b..3019ec7bf7d2d256be5e22d31165075631203bb0 100644 (file)
@@ -38,7 +38,7 @@ struct mvebu_pinctrl_function {
 
 struct mvebu_pinctrl_group {
        const char *name;
-       struct mvebu_mpp_ctrl *ctrl;
+       const struct mvebu_mpp_ctrl *ctrl;
        struct mvebu_mpp_ctrl_setting *settings;
        unsigned num_settings;
        unsigned gid;
@@ -576,7 +576,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
        pctl->num_groups = 0;
        pctl->desc.npins = 0;
        for (n = 0; n < soc->ncontrols; n++) {
-               struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
+               const struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
 
                pctl->desc.npins += ctrl->npins;
                /* initialize control's pins[] array */
@@ -620,7 +620,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
        /* assign mpp controls to groups */
        gid = 0;
        for (n = 0; n < soc->ncontrols; n++) {
-               struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
+               const struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
                pctl->groups[gid].gid = gid;
                pctl->groups[gid].ctrl = ctrl;
                pctl->groups[gid].name = ctrl->name;
index b75a5f4adf3b1fce09c200e8bc585c51c1e791d4..7f7c24ac49e36b572504ec89cc49fc89bb2b4d6e 100644 (file)
@@ -105,7 +105,7 @@ struct mvebu_mpp_mode {
  */
 struct mvebu_pinctrl_soc_info {
        u8 variant;
-       struct mvebu_mpp_ctrl *controls;
+       const struct mvebu_mpp_ctrl *controls;
        int ncontrols;
        struct mvebu_mpp_mode *modes;
        int nmodes;
index 84e144167b44d37777fe1f7062e19a9d28b83131..18c83b0a5a7c781f11b08d9463e0a841cdbde8cc 100644 (file)
@@ -161,7 +161,7 @@ static struct mvebu_mpp_mode orion_mpp_modes[] = {
                 MPP_VAR_FUNCTION(0x5, "gpio", NULL,        V_5182)),
 };
 
-static struct mvebu_mpp_ctrl orion_mpp_controls[] = {
+static const struct mvebu_mpp_ctrl orion_mpp_controls[] = {
        MPP_FUNC_CTRL(0, 19, NULL, orion_mpp_ctrl),
 };