linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: imx: remove unused gpoup_index field
@ 2016-10-18 22:47 Vladimir Zapolskiy
  2016-10-20 20:17 ` Stefan Agner
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Zapolskiy @ 2016-10-18 22:47 UTC (permalink / raw)
  To: Linus Walleij, Shawn Guo, Stefan Agner
  Cc: Philipp Zabel, Alexander Shiyan, linux-gpio

The group_index field of struct imx_pinctrl_soc_info does not serve
any particular purpose and its usage can be safely replaced by
a preexisting local variable.

Also Stefan Agner reports that the usage of the group_index field
without reinitialization may lead to an oops on a repeated driver
probe, this is found with DEBUG_TEST_DRIVER_REMOVE option enabled.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
The change is supposed to obsolete Stefan's change:

   https://patchwork.ozlabs.org/patch/683885/

The change is tested on i.MX6Q platform only.

 drivers/pinctrl/freescale/pinctrl-imx.c | 2 +-
 drivers/pinctrl/freescale/pinctrl-imx.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 47613201269a..3425d10c1478 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -628,7 +628,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
 
 	for_each_child_of_node(np, child) {
 		func->groups[i] = child->name;
-		grp = &info->groups[info->group_index++];
+		grp = &info->groups[i];
 		imx_pinctrl_parse_groups(child, grp, info, i++);
 	}
 
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
index 8af8aa2897ab..eaf893967453 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx.h
@@ -78,7 +78,6 @@ struct imx_pinctrl_soc_info {
 	struct imx_pin_reg *pin_regs;
 	struct imx_pin_group *groups;
 	unsigned int ngroups;
-	unsigned int group_index;
 	struct imx_pmx_func *functions;
 	unsigned int nfunctions;
 	unsigned int flags;
-- 
2.8.1


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

end of thread, other threads:[~2016-10-24  0:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 22:47 [PATCH] pinctrl: imx: remove unused gpoup_index field Vladimir Zapolskiy
2016-10-20 20:17 ` Stefan Agner
2016-10-24  0:18   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).