From: Mark Brown <broonie@kernel.org>
To: pascal paillet <p.paillet@st.com>
Cc: Mark Brown <broonie@kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"benjamin.gaignard@linaro.org" <benjamin.gaignard@linaro.org>,
Pascal PAILLET-LME <p.paillet@st.com>,
linux-kernel@vger.kernel.org
Subject: Applied "regulator: core: Link consumer with regulator driver" to the regulator tree
Date: Thu, 05 Jul 2018 18:55:38 +0100 [thread overview]
Message-ID: <E1fb8Ti-00026e-NU@debutante> (raw)
In-Reply-To: <1530800748-7300-3-git-send-email-p.paillet@st.com>
The patch
regulator: core: Link consumer with regulator driver
has been applied to the regulator tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
From ed1ae2dd9f242c7a36e8e39100f6a7f6bcdfdd89 Mon Sep 17 00:00:00 2001
From: pascal paillet <p.paillet@st.com>
Date: Thu, 5 Jul 2018 14:25:56 +0000
Subject: [PATCH] regulator: core: Link consumer with regulator driver
Add a device link between the consumer and the driver so that
the consumer is not suspended before the driver. The goal is to avoid
implementing suspend_late ops in regulator drivers.
Signed-off-by: pascal paillet <p.paillet@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/regulator/core.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index da9b0fed8330..bb1324f93143 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1740,6 +1740,8 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
rdev->use_count = 0;
}
+ device_link_add(dev, &rdev->dev, DL_FLAG_STATELESS);
+
return regulator;
}
@@ -1829,9 +1831,21 @@ static void _regulator_put(struct regulator *regulator)
debugfs_remove_recursive(regulator->debugfs);
- /* remove any sysfs entries */
- if (regulator->dev)
+ if (regulator->dev) {
+ int count = 0;
+ struct regulator *r;
+
+ list_for_each_entry(r, &rdev->consumer_list, list)
+ if (r->dev == regulator->dev)
+ count++;
+
+ if (count == 1)
+ device_link_remove(regulator->dev, &rdev->dev);
+
+ /* remove any sysfs entries */
sysfs_remove_link(&rdev->dev.kobj, regulator->supply_name);
+ }
+
regulator_lock(rdev);
list_del(®ulator->list);
--
2.18.0.rc2
next prev parent reply other threads:[~2018-07-05 17:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 14:25 [PATCH 0/3] link regulator consumer with driver Pascal PAILLET-LME
2018-07-05 14:25 ` [PATCH 2/3] regulator: core: Link consumer with regulator driver Pascal PAILLET-LME
2018-07-05 16:53 ` Mark Brown
2018-07-05 17:53 ` gregkh
2018-07-05 17:55 ` Mark Brown [this message]
[not found] ` <CGME20180709111753eucas1p1f32e66fb2f7ea3216097cd72a132355d@eucas1p1.samsung.com>
2018-07-09 11:17 ` Applied "regulator: core: Link consumer with regulator driver" to the regulator tree Marek Szyprowski
2018-07-09 12:13 ` Benjamin Gaignard
2018-07-09 12:26 ` Mark Brown
2018-07-05 14:25 ` [PATCH 1/3] driver core: Add device_link_remove function Pascal PAILLET-LME
2018-07-05 16:54 ` Mark Brown
2018-07-05 17:55 ` Applied "driver core: Add device_link_remove function" to the regulator tree Mark Brown
2018-07-05 14:25 ` [PATCH 3/3] regulator: core: Change suspend_late to suspend Pascal PAILLET-LME
2018-07-05 17:08 ` Applied "regulator: core: Change suspend_late to suspend" to the regulator tree Mark Brown
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=E1fb8Ti-00026e-NU@debutante \
--to=broonie@kernel.org \
--cc=benjamin.gaignard@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=p.paillet@st.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
Powered by JetHome