From: Bartosz Golaszewski <bartosz.golaszew...@linaro.org>

With all users of struct function_desc limited to only accessing it using
the dedicated function and never modifying it, we can now constify the
return value of pinmux_generic_get_function() treewide.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszew...@linaro.org>
---
 drivers/pinctrl/freescale/pinctrl-imx.c   | 2 +-
 drivers/pinctrl/mediatek/pinctrl-airoha.c | 2 +-
 drivers/pinctrl/mediatek/pinctrl-moore.c  | 2 +-
 drivers/pinctrl/pinctrl-equilibrium.c     | 2 +-
 drivers/pinctrl/pinctrl-ingenic.c         | 2 +-
 drivers/pinctrl/pinctrl-keembay.c         | 2 +-
 drivers/pinctrl/pinctrl-single.c          | 4 ++--
 drivers/pinctrl/pinmux.c                  | 4 ++--
 drivers/pinctrl/pinmux.h                  | 4 ++--
 drivers/pinctrl/renesas/pinctrl-rza1.c    | 2 +-
 drivers/pinctrl/renesas/pinctrl-rza2.c    | 2 +-
 drivers/pinctrl/renesas/pinctrl-rzg2l.c   | 2 +-
 drivers/pinctrl/renesas/pinctrl-rzv2m.c   | 2 +-
 13 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c 
b/drivers/pinctrl/freescale/pinctrl-imx.c
index 
d5d42c9ad5fe9dcf7c25ad393688e714b02db678..9ed84479a5b43871861f46fe1326f1dfadc7f63c
 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -245,7 +245,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, 
unsigned selector,
 {
        struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
        const struct imx_pinctrl_soc_info *info = ipctl->info;
-       struct function_desc *func;
+       const struct function_desc *func;
        struct group_desc *grp;
        struct imx_pin *pin;
        unsigned int npins;
diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c 
b/drivers/pinctrl/mediatek/pinctrl-airoha.c
index 
aa71e02b661c992c117418af910ae157c4f75fff..9a95577439a1b50607427756a713c8122c7c4af1
 100644
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -2446,7 +2446,7 @@ static int airoha_pinmux_set_mux(struct pinctrl_dev 
*pctrl_dev,
 {
        struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev);
        const struct airoha_pinctrl_func *func;
-       struct function_desc *desc;
+       const struct function_desc *desc;
        struct group_desc *grp;
        int i;
 
diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c 
b/drivers/pinctrl/mediatek/pinctrl-moore.c
index 
68710dab2aa3ff649bb0cf579122ecaa0c257fdf..ec0005246c19a156079807acddc93bcb767d1222
 100644
--- a/drivers/pinctrl/mediatek/pinctrl-moore.c
+++ b/drivers/pinctrl/mediatek/pinctrl-moore.c
@@ -43,7 +43,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev,
                              unsigned int selector, unsigned int group)
 {
        struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
-       struct function_desc *func;
+       const struct function_desc *func;
        struct group_desc *grp;
        int i, err;
 
diff --git a/drivers/pinctrl/pinctrl-equilibrium.c 
b/drivers/pinctrl/pinctrl-equilibrium.c
index 
fce804d42e7d7f9233b2da0fb26e482170629424..18f0da58c96d4f0fad6535fd88e69fc8acf96a94
 100644
--- a/drivers/pinctrl/pinctrl-equilibrium.c
+++ b/drivers/pinctrl/pinctrl-equilibrium.c
@@ -319,7 +319,7 @@ static int eqbr_pinmux_set_mux(struct pinctrl_dev *pctldev,
                               unsigned int selector, unsigned int group)
 {
        struct eqbr_pinctrl_drv_data *pctl = pinctrl_dev_get_drvdata(pctldev);
-       struct function_desc *func;
+       const struct function_desc *func;
        struct group_desc *grp;
        unsigned int *pinmux;
        int i;
diff --git a/drivers/pinctrl/pinctrl-ingenic.c 
b/drivers/pinctrl/pinctrl-ingenic.c
index 
0ee8554c5446c4167c9b0e6b9397a2507ca57419..f89f8ec06ac63227930a38dbc80f00333cc15b48
 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -4000,7 +4000,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev 
*pctldev,
                unsigned int selector, unsigned int group)
 {
        struct ingenic_pinctrl *jzpc = pinctrl_dev_get_drvdata(pctldev);
-       struct function_desc *func;
+       const struct function_desc *func;
        struct group_desc *grp;
        unsigned int i;
        uintptr_t mode;
diff --git a/drivers/pinctrl/pinctrl-keembay.c 
b/drivers/pinctrl/pinctrl-keembay.c
index 
060d64ff3d9f01ecd3374935af66b55c38f60d67..87d081226f45467d9c92cc9e8ea63d41fd2f0fcb
 100644
--- a/drivers/pinctrl/pinctrl-keembay.c
+++ b/drivers/pinctrl/pinctrl-keembay.c
@@ -935,7 +935,7 @@ static int keembay_set_mux(struct pinctrl_dev *pctldev, 
unsigned int fun_sel,
                           unsigned int grp_sel)
 {
        struct keembay_pinctrl *kpc = pinctrl_dev_get_drvdata(pctldev);
-       struct function_desc *func;
+       const struct function_desc *func;
        struct group_desc *grp;
        unsigned int val;
        u8 pin_mode;
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 
5cda6201b60f53e62f3f50b8641ec894106111e0..c9adf5fcb1c76445d4812de449edf09878771a46
 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -336,7 +336,7 @@ static int pcs_get_function(struct pinctrl_dev *pctldev, 
unsigned pin,
        struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
        struct pin_desc *pdesc = pin_desc_get(pctldev, pin);
        const struct pinctrl_setting_mux *setting;
-       struct function_desc *function;
+       const struct function_desc *function;
        unsigned fselector;
 
        /* If pin is not described in DTS & enabled, mux_setting is NULL. */
@@ -360,7 +360,7 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, 
unsigned fselector,
        unsigned group)
 {
        struct pcs_device *pcs;
-       struct function_desc *function;
+       const struct function_desc *function;
        struct pcs_function *func;
        int i;
 
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 
79814758a084570adea0ea1a3151d186f65d1d1f..62bd4aa53b2b22cb09eacfb05398205f2fe391b9
 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -847,8 +847,8 @@ EXPORT_SYMBOL_GPL(pinmux_generic_get_function_groups);
  * @pctldev: pin controller device
  * @selector: function number
  */
-struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
-                                                 unsigned int selector)
+const struct function_desc *
+pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int selector)
 {
        struct function_desc *function;
 
diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h
index 
bdb5be1a636ead9695410824b5557937c5baa89a..549ab10f7afbda32fadf4ad151401180bed2064f
 100644
--- a/drivers/pinctrl/pinmux.h
+++ b/drivers/pinctrl/pinmux.h
@@ -152,8 +152,8 @@ int pinmux_generic_get_function_groups(struct pinctrl_dev 
*pctldev,
                                       const char * const **groups,
                                       unsigned int * const ngroups);
 
-struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
-                                                 unsigned int selector);
+const struct function_desc *
+pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int 
selector);
 
 int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
                                const char *name,
diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c 
b/drivers/pinctrl/renesas/pinctrl-rza1.c
index 
3d8492c917104afbf15c8f697ba4afabafa3a5cf..26826c8b5441b1a056900fdfc1d68c0c5cd3e6ba
 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
@@ -1120,7 +1120,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, 
unsigned int selector,
 {
        struct rza1_pinctrl *rza1_pctl = pinctrl_dev_get_drvdata(pctldev);
        struct rza1_mux_conf *mux_confs;
-       struct function_desc *func;
+       const struct function_desc *func;
        struct group_desc *grp;
        int i;
 
diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c 
b/drivers/pinctrl/renesas/pinctrl-rza2.c
index 
7a0b268d3eb91a42911f372e66805291344f8750..7e9eff522204413c83779932cd702edc02ec2686
 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza2.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza2.c
@@ -442,7 +442,7 @@ static int rza2_set_mux(struct pinctrl_dev *pctldev, 
unsigned int selector,
                        unsigned int group)
 {
        struct rza2_pinctrl_priv *priv = pinctrl_dev_get_drvdata(pctldev);
-       struct function_desc *func;
+       const struct function_desc *func;
        unsigned int i, *psel_val;
        struct group_desc *grp;
 
diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c 
b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 
2a10ae0bf5bdd97c10ff4fe4b890a70744a97578..76d4ce78d0dece3bb95779d60f235ce85df25403
 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -549,7 +549,7 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev 
*pctldev,
 {
        struct rzg2l_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
        const struct rzg2l_hwcfg *hwcfg = pctrl->data->hwcfg;
-       struct function_desc *func;
+       const struct function_desc *func;
        unsigned int i, *psel_val;
        struct group_desc *group;
        const unsigned int *pins;
diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c 
b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
index 
a17b68b4c466e2ca91cb26a713a088e309d5e167..a60cdf8f3eef6e3f14e3fe19e7d57515d6b455fa
 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
@@ -162,7 +162,7 @@ static int rzv2m_pinctrl_set_mux(struct pinctrl_dev 
*pctldev,
                                 unsigned int group_selector)
 {
        struct rzv2m_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
-       struct function_desc *func;
+       const struct function_desc *func;
        unsigned int i, *psel_val;
        struct group_desc *group;
        const unsigned int *pins;

-- 
2.48.1


Reply via email to