From: Shawn Guo <shawnguo@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
Shawn Guo <shawn.guo@linaro.org>
Subject: [PATCH] pinctrl: zte: fix group_desc initialization
Date: Mon, 22 May 2017 21:59:35 +0800 [thread overview]
Message-ID: <1495461575-29488-1-git-send-email-shawnguo@kernel.org> (raw)
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
next reply other threads:[~2017-05-22 14:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 13:59 Shawn Guo [this message]
2017-05-29 8:17 ` [PATCH] pinctrl: zte: fix group_desc initialization Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495461575-29488-1-git-send-email-shawnguo@kernel.org \
--to=shawnguo@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=shawn.guo@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).