Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
@ 2017-08-10 10:06 Julia Lawall
  2017-08-10 10:06 ` [PATCH 03/17] pinctrl: armada-37xx: " Julia Lawall
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Julia Lawall @ 2017-08-10 10:06 UTC (permalink / raw)
  To: linux-arm-kernel

These structures are only stored in fields of a pinctrl_desc
structure that are const. Make the structures const as well.

Done with the help of Coccinelle.

---

 drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c  |    4 ++--
 drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c  |    6 +++---
 drivers/pinctrl/bcm/pinctrl-bcm281xx.c      |    2 +-
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    2 +-
 drivers/pinctrl/pinctrl-adi2.c              |    4 ++--
 drivers/pinctrl/pinctrl-artpec6.c           |    2 +-
 drivers/pinctrl/pinctrl-digicolor.c         |    4 ++--
 drivers/pinctrl/pinctrl-ingenic.c           |    6 +++---
 drivers/pinctrl/pinctrl-rza1.c              |    2 +-
 drivers/pinctrl/pinctrl-st.c                |    6 +++---
 drivers/pinctrl/pinctrl-tb10x.c             |    4 ++--
 drivers/pinctrl/pinctrl-tz1090-pdc.c        |    6 +++---
 drivers/pinctrl/pinctrl-tz1090.c            |    6 +++---
 drivers/pinctrl/sirf/pinctrl-atlas7.c       |    2 +-
 drivers/pinctrl/sirf/pinctrl-sirf.c         |    4 ++--
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c     |    4 ++--
 drivers/pinctrl/vt8500/pinctrl-wmt.c        |    6 +++---
 17 files changed, 35 insertions(+), 35 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 03/17] pinctrl: armada-37xx: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures Julia Lawall
@ 2017-08-10 10:06 ` Julia Lawall
  2017-08-10 10:06 ` [PATCH 04/17] pinctrl: st: " Julia Lawall
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2017-08-10 10:06 UTC (permalink / raw)
  To: linux-arm-kernel

This pinconf_ops structure is only stored in the const pinconf_ops
field of a pinctrl_desc structure. Make the pinconf_ops structure
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/pinctrl/mvebu/pinctrl-armada-37xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index f024e25..997ff05 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -243,7 +243,7 @@ static int armada_37xx_pin_config_group_set(struct pinctrl_dev *pctldev,
 	return -ENOTSUPP;
 }
 
-static struct pinconf_ops armada_37xx_pinconf_ops = {
+static const struct pinconf_ops armada_37xx_pinconf_ops = {
 	.is_generic = true,
 	.pin_config_group_get = armada_37xx_pin_config_group_get,
 	.pin_config_group_set = armada_37xx_pin_config_group_set,

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 04/17] pinctrl: st: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures Julia Lawall
  2017-08-10 10:06 ` [PATCH 03/17] pinctrl: armada-37xx: " Julia Lawall
@ 2017-08-10 10:06 ` Julia Lawall
  2017-08-10 11:03   ` Patrice CHOTARD
  2017-08-10 10:06 ` [PATCH 05/17] pinctrl: sirf: atlas7: " Julia Lawall
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Julia Lawall @ 2017-08-10 10:06 UTC (permalink / raw)
  To: linux-arm-kernel

These structures are only stored in fields of a pinctrl_desc
structure (confops, pctlops, and pmxops) that are const. Make the
structures const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/pinctrl/pinctrl-st.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 7ac8b1e..aed8006 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -861,7 +861,7 @@ static void st_pctl_dt_free_map(struct pinctrl_dev *pctldev,
 {
 }
 
-static struct pinctrl_ops st_pctlops = {
+static const struct pinctrl_ops st_pctlops = {
 	.get_groups_count	= st_pctl_get_groups_count,
 	.get_group_pins		= st_pctl_get_group_pins,
 	.get_group_name		= st_pctl_get_group_name,
@@ -928,7 +928,7 @@ static int st_pmx_set_gpio_direction(struct pinctrl_dev *pctldev,
 	return 0;
 }
 
-static struct pinmux_ops st_pmxops = {
+static const struct pinmux_ops st_pmxops = {
 	.get_functions_count	= st_pmx_get_funcs_count,
 	.get_function_name	= st_pmx_get_fname,
 	.get_function_groups	= st_pmx_get_groups,
@@ -1025,7 +1025,7 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev,
 		ST_PINCONF_UNPACK_RT_DELAY(config));
 }
 
-static struct pinconf_ops st_confops = {
+static const struct pinconf_ops st_confops = {
 	.pin_config_get		= st_pinconf_get,
 	.pin_config_set		= st_pinconf_set,
 	.pin_config_dbg_show	= st_pinconf_dbg_show,

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 05/17] pinctrl: sirf: atlas7: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures Julia Lawall
  2017-08-10 10:06 ` [PATCH 03/17] pinctrl: armada-37xx: " Julia Lawall
  2017-08-10 10:06 ` [PATCH 04/17] pinctrl: st: " Julia Lawall
@ 2017-08-10 10:06 ` Julia Lawall
  2017-08-10 10:06 ` [PATCH 06/17] pinctrl: sirf: " Julia Lawall
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2017-08-10 10:06 UTC (permalink / raw)
  To: linux-arm-kernel

This pinmux_ops structure is only stored in the const pmxops field
of a pinctrl_desc structure. Make the pinmux_ops structure const as
well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/pinctrl/sirf/pinctrl-atlas7.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
index d1ef82c..17c326c 100644
--- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
+++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
@@ -5261,7 +5261,7 @@ static int atlas7_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
 	return 0;
 }
 
-static struct pinmux_ops atlas7_pinmux_ops = {
+static const struct pinmux_ops atlas7_pinmux_ops = {
 	.get_functions_count = atlas7_pmx_get_funcs_count,
 	.get_function_name = atlas7_pmx_get_func_name,
 	.get_function_groups = atlas7_pmx_get_func_groups,

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 06/17] pinctrl: sirf: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures Julia Lawall
                   ` (2 preceding siblings ...)
  2017-08-10 10:06 ` [PATCH 05/17] pinctrl: sirf: atlas7: " Julia Lawall
@ 2017-08-10 10:06 ` Julia Lawall
  2017-08-10 10:06 ` [PATCH 07/17] pinctrl: digicolor: " Julia Lawall
  2017-08-22 12:43 ` [PATCH 00/17] " Linus Walleij
  5 siblings, 0 replies; 9+ messages in thread
From: Julia Lawall @ 2017-08-10 10:06 UTC (permalink / raw)
  To: linux-arm-kernel

These structures are only stored in fields of a pinctrl_desc
structure (pctlops and pmxops) that are const. Make the
structures const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/pinctrl/sirf/pinctrl-sirf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index 80bfd47..d3ef059 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -133,7 +133,7 @@ static void sirfsoc_dt_free_map(struct pinctrl_dev *pctldev,
 	kfree(map);
 }
 
-static struct pinctrl_ops sirfsoc_pctrl_ops = {
+static const struct pinctrl_ops sirfsoc_pctrl_ops = {
 	.get_groups_count = sirfsoc_get_groups_count,
 	.get_group_name = sirfsoc_get_group_name,
 	.get_group_pins = sirfsoc_get_group_pins,
@@ -229,7 +229,7 @@ static int sirfsoc_pinmux_request_gpio(struct pinctrl_dev *pmxdev,
 	return 0;
 }
 
-static struct pinmux_ops sirfsoc_pinmux_ops = {
+static const struct pinmux_ops sirfsoc_pinmux_ops = {
 	.set_mux = sirfsoc_pinmux_set_mux,
 	.get_functions_count = sirfsoc_pinmux_get_funcs_count,
 	.get_function_name = sirfsoc_pinmux_get_func_name,

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 07/17] pinctrl: digicolor: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures Julia Lawall
                   ` (3 preceding siblings ...)
  2017-08-10 10:06 ` [PATCH 06/17] pinctrl: sirf: " Julia Lawall
@ 2017-08-10 10:06 ` Julia Lawall
  2017-08-10 12:39   ` Baruch Siach
  2017-08-22 12:43 ` [PATCH 00/17] " Linus Walleij
  5 siblings, 1 reply; 9+ messages in thread
From: Julia Lawall @ 2017-08-10 10:06 UTC (permalink / raw)
  To: linux-arm-kernel

These structures are only stored in fields of a pinctrl_desc
structure (pctlops and pmxops) that are const. Make the
structures const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/pinctrl/pinctrl-digicolor.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
index 639a57e..ce269ce 100644
--- a/drivers/pinctrl/pinctrl-digicolor.c
+++ b/drivers/pinctrl/pinctrl-digicolor.c
@@ -79,7 +79,7 @@ static int dc_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector,
 	return 0;
 }
 
-static struct pinctrl_ops dc_pinctrl_ops = {
+static const struct pinctrl_ops dc_pinctrl_ops = {
 	.get_groups_count	= dc_get_groups_count,
 	.get_group_name		= dc_get_group_name,
 	.get_group_pins		= dc_get_group_pins,
@@ -161,7 +161,7 @@ static int dc_pmx_request_gpio(struct pinctrl_dev *pcdev,
 	return 0;
 }
 
-static struct pinmux_ops dc_pmxops = {
+static const struct pinmux_ops dc_pmxops = {
 	.get_functions_count	= dc_get_functions_count,
 	.get_function_name	= dc_get_fname,
 	.get_function_groups	= dc_get_groups,

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 04/17] pinctrl: st: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 ` [PATCH 04/17] pinctrl: st: " Julia Lawall
@ 2017-08-10 11:03   ` Patrice CHOTARD
  0 siblings, 0 replies; 9+ messages in thread
From: Patrice CHOTARD @ 2017-08-10 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia

On 08/10/2017 12:06 PM, Julia Lawall wrote:
> These structures are only stored in fields of a pinctrl_desc
> structure (confops, pctlops, and pmxops) that are const. Make the
> structures const as well.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>   drivers/pinctrl/pinctrl-st.c |    6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 7ac8b1e..aed8006 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -861,7 +861,7 @@ static void st_pctl_dt_free_map(struct pinctrl_dev *pctldev,
>   {
>   }
>   
> -static struct pinctrl_ops st_pctlops = {
> +static const struct pinctrl_ops st_pctlops = {
>   	.get_groups_count	= st_pctl_get_groups_count,
>   	.get_group_pins		= st_pctl_get_group_pins,
>   	.get_group_name		= st_pctl_get_group_name,
> @@ -928,7 +928,7 @@ static int st_pmx_set_gpio_direction(struct pinctrl_dev *pctldev,
>   	return 0;
>   }
>   
> -static struct pinmux_ops st_pmxops = {
> +static const struct pinmux_ops st_pmxops = {
>   	.get_functions_count	= st_pmx_get_funcs_count,
>   	.get_function_name	= st_pmx_get_fname,
>   	.get_function_groups	= st_pmx_get_groups,
> @@ -1025,7 +1025,7 @@ static void st_pinconf_dbg_show(struct pinctrl_dev *pctldev,
>   		ST_PINCONF_UNPACK_RT_DELAY(config));
>   }
>   
> -static struct pinconf_ops st_confops = {
> +static const struct pinconf_ops st_confops = {
>   	.pin_config_get		= st_pinconf_get,
>   	.pin_config_set		= st_pinconf_set,
>   	.pin_config_dbg_show	= st_pinconf_dbg_show,
> 

Acked-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 07/17] pinctrl: digicolor: constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 ` [PATCH 07/17] pinctrl: digicolor: " Julia Lawall
@ 2017-08-10 12:39   ` Baruch Siach
  0 siblings, 0 replies; 9+ messages in thread
From: Baruch Siach @ 2017-08-10 12:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Julia,

On Thu, Aug 10, 2017 at 12:06:19PM +0200, Julia Lawall wrote:
> These structures are only stored in fields of a pinctrl_desc
> structure (pctlops and pmxops) that are const. Make the
> structures const as well.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Baruch Siach <baruch@tkos.co.il>

Thanks,
baruch

> ---
>  drivers/pinctrl/pinctrl-digicolor.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
> index 639a57e..ce269ce 100644
> --- a/drivers/pinctrl/pinctrl-digicolor.c
> +++ b/drivers/pinctrl/pinctrl-digicolor.c
> @@ -79,7 +79,7 @@ static int dc_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector,
>  	return 0;
>  }
>  
> -static struct pinctrl_ops dc_pinctrl_ops = {
> +static const struct pinctrl_ops dc_pinctrl_ops = {
>  	.get_groups_count	= dc_get_groups_count,
>  	.get_group_name		= dc_get_group_name,
>  	.get_group_pins		= dc_get_group_pins,
> @@ -161,7 +161,7 @@ static int dc_pmx_request_gpio(struct pinctrl_dev *pcdev,
>  	return 0;
>  }
>  
> -static struct pinmux_ops dc_pmxops = {
> +static const struct pinmux_ops dc_pmxops = {
>  	.get_functions_count	= dc_get_functions_count,
>  	.get_function_name	= dc_get_fname,
>  	.get_function_groups	= dc_get_groups,

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures
  2017-08-10 10:06 [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures Julia Lawall
                   ` (4 preceding siblings ...)
  2017-08-10 10:06 ` [PATCH 07/17] pinctrl: digicolor: " Julia Lawall
@ 2017-08-22 12:43 ` Linus Walleij
  5 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2017-08-22 12:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 10, 2017 at 12:06 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> These structures are only stored in fields of a pinctrl_desc
> structure that are const. Make the structures const as well.
>
> Done with the help of Coccinelle.

Thanks Julia, all patches applied with relevant ACKs collected.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-08-22 12:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 10:06 [PATCH 00/17] constify pinconf_ops, pinctrl_ops, and pinmux_ops structures Julia Lawall
2017-08-10 10:06 ` [PATCH 03/17] pinctrl: armada-37xx: " Julia Lawall
2017-08-10 10:06 ` [PATCH 04/17] pinctrl: st: " Julia Lawall
2017-08-10 11:03   ` Patrice CHOTARD
2017-08-10 10:06 ` [PATCH 05/17] pinctrl: sirf: atlas7: " Julia Lawall
2017-08-10 10:06 ` [PATCH 06/17] pinctrl: sirf: " Julia Lawall
2017-08-10 10:06 ` [PATCH 07/17] pinctrl: digicolor: " Julia Lawall
2017-08-10 12:39   ` Baruch Siach
2017-08-22 12:43 ` [PATCH 00/17] " Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox