linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: zte: fix group_desc initialization
@ 2017-05-22 13:59 Shawn Guo
  2017-05-29  8:17 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn Guo @ 2017-05-22 13:59 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-arm-kernel, linux-gpio, Shawn Guo

From: Shawn Guo <shawn.guo@linaro.org>

There are a couple of issues with group_desc initialization in function
zx_pinctrl_build_state().

 - num_pins is not initialized and remains zero.
 - pins shouldn't be initialized with a pointer to variable in the
   stack.

With them fixed, pin_request() in pinmux_enable_setting() can be invoked
correctly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
Hi Linus,

This is a fix for ZTE pinctrl driver that is queued on your devel branch.

Shawn

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

diff --git a/drivers/pinctrl/zte/pinctrl-zx.c b/drivers/pinctrl/zte/pinctrl-zx.c
index 2aca4e4b3f1c..787e3967bd5c 100644
--- a/drivers/pinctrl/zte/pinctrl-zx.c
+++ b/drivers/pinctrl/zte/pinctrl-zx.c
@@ -282,10 +282,10 @@ static int zx_pinctrl_build_state(struct platform_device *pdev)
 	for (i = 0; i < ngroups; i++) {
 		const struct pinctrl_pin_desc *pindesc = info->pins + i;
 		struct group_desc *group = groups + i;
-		int id = pindesc->number;
 
 		group->name = pindesc->name;
-		group->pins = &id;
+		group->pins = (int *) &pindesc->number;
+		group->num_pins = 1;
 		radix_tree_insert(&pctldev->pin_group_tree, i, group);
 	}
 
-- 
1.9.1


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

* Re: [PATCH] pinctrl: zte: fix group_desc initialization
  2017-05-22 13:59 [PATCH] pinctrl: zte: fix group_desc initialization Shawn Guo
@ 2017-05-29  8:17 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-05-29  8:17 UTC (permalink / raw)
  To: Shawn Guo
  Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	Shawn Guo

On Mon, May 22, 2017 at 3:59 PM, Shawn Guo <shawnguo@kernel.org> wrote:

> From: Shawn Guo <shawn.guo@linaro.org>
>
> There are a couple of issues with group_desc initialization in function
> zx_pinctrl_build_state().
>
>  - num_pins is not initialized and remains zero.
>  - pins shouldn't be initialized with a pointer to variable in the
>    stack.
>
> With them fixed, pin_request() in pinmux_enable_setting() can be invoked
> correctly.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Patch applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2017-05-29  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 13:59 [PATCH] pinctrl: zte: fix group_desc initialization Shawn Guo
2017-05-29  8: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;
as well as URLs for NNTP newsgroup(s).