From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Haojian Zhuang <haojian.zhuang@linaro.org>,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
Paul Cercueil <paul@crapouillou.net>,
Sean Wang <sean.wang@mediatek.com>
Subject: [PATCH 1/5] pinctrl: core: Return selector to the pinctrl driver
Date: Fri, 15 Jun 2018 04:11:37 -0700 [thread overview]
Message-ID: <20180615111141.37184-2-tony@atomide.com> (raw)
In-Reply-To: <20180615111141.37184-1-tony@atomide.com>
We must return the selector from pinctrl_generic_add_group() so
pin controller device drivers can remove the right group if needed
for deferred probe for example.
Note that fixes are also needed for the pin controller drivers to
use the selector value.
Fixes: c7059c5ac70a ("pinctrl: core: Add generic pinctrl functions
for managing groups")
Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/pinctrl/core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -631,6 +631,7 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
int *pins, int num_pins, void *data)
{
struct group_desc *group;
+ int selector = pctldev->num_groups;
group = devm_kzalloc(pctldev->dev, sizeof(*group), GFP_KERNEL);
if (!group)
@@ -641,12 +642,12 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
group->num_pins = num_pins;
group->data = data;
- radix_tree_insert(&pctldev->pin_group_tree, pctldev->num_groups,
+ radix_tree_insert(&pctldev->pin_group_tree, selector,
group);
pctldev->num_groups++;
- return 0;
+ return selector;
}
EXPORT_SYMBOL_GPL(pinctrl_generic_add_group);
--
2.17.1
next prev parent reply other threads:[~2018-06-15 11:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 11:11 [PATCH 0/5] pinctrl fixes for generic functions and groups Tony Lindgren
2018-06-15 11:11 ` Tony Lindgren [this message]
2018-06-17 16:50 ` [PATCH 1/5] pinctrl: core: Return selector to the pinctrl driver Andy Shevchenko
2018-06-18 6:48 ` Tony Lindgren
2018-06-15 11:11 ` [PATCH 2/5] pinctrl: pinmux: " Tony Lindgren
2018-06-17 16:51 ` Andy Shevchenko
2018-06-15 11:11 ` [PATCH 3/5] pinctrl: single: Fix group and function selector use Tony Lindgren
2018-06-15 11:11 ` [PATCH 4/5] pinctrl: rza1: Fix selector use for groups and functions Tony Lindgren
2018-06-19 4:16 ` jacopo mondi
2018-06-15 11:11 ` [PATCH 5/5] pinctrl: core: Remove broken remove_last group and pinmux functions Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2018-06-19 9:31 [PATCHv2 0/5] pinctrl fixes for generic functions and groups Tony Lindgren
2018-06-19 9:31 ` [PATCH 1/5] pinctrl: core: Return selector to the pinctrl driver Tony Lindgren
2018-07-05 9:10 [PATCHv3 0/5] pinctrl fixes for generic functions and groups Tony Lindgren
2018-07-05 9:10 ` [PATCH 1/5] pinctrl: core: Return selector to the pinctrl driver Tony Lindgren
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=20180615111141.37184-2-tony@atomide.com \
--to=tony@atomide.com \
--cc=haojian.zhuang@linaro.org \
--cc=jacopo+renesas@jmondi.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=sean.wang@mediatek.com \
/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).