public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Tony Lindgren <tony@atomide.com>,
	Doug Anderson <dianders@chromium.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Luca Weiss <luca.weiss@fairphone.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: [RFC v1 3/4] regulator: core: Probe regulator devices
Date: Sat, 18 Feb 2023 00:32:50 -0800	[thread overview]
Message-ID: <20230218083252.2044423-4-saravanak@google.com> (raw)
In-Reply-To: <20230218083252.2044423-1-saravanak@google.com>

Since devices added to a bus can be probed, add a stub probe function
for regulator devices.

Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 drivers/regulator/core.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index b6700d50d230..d5f9fdd79c14 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5780,6 +5780,17 @@ static const struct dev_pm_ops __maybe_unused regulator_pm_ops = {
 };
 #endif
 
+static int regulator_drv_probe(struct device *dev)
+{
+	return 0;
+}
+
+static struct device_driver regulator_drv = {
+	.name = "regulator_drv",
+	.bus = &regulator_bus,
+	.probe = regulator_drv_probe,
+};
+
 struct bus_type regulator_bus = {
 	.name = "regulator",
 	.remove = regulator_dev_release,
@@ -6123,6 +6134,10 @@ static int __init regulator_init(void)
 	if (ret)
 		goto unreg_compat;
 
+	ret = driver_register(&regulator_drv);
+	if (ret)
+		goto unreg_bus;
+
 	debugfs_root = debugfs_create_dir("regulator", NULL);
 	if (!debugfs_root)
 		pr_warn("regulator: Failed to create debugfs directory\n");
@@ -6141,6 +6156,8 @@ static int __init regulator_init(void)
 
 	return ret;
 
+unreg_bus:
+	bus_unregister(&regulator_bus);
 unreg_compat:
 	class_compat_unregister(regulator_compat_class);
 	return ret;
-- 
2.39.2.637.g21b0678d19-goog


  parent reply	other threads:[~2023-02-18  8:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230218083300eucas1p28c7c584877b8914a3b88904690be82f6@eucas1p2.samsung.com>
2023-02-18  8:32 ` [RFC v1 0/4] Simplify regulator supply resolution code by offloading to driver core Saravana Kannan
2023-02-18  8:32   ` [RFC v1 1/4] regulator: core: Add regulator devices to bus instead of class Saravana Kannan
2023-02-18  8:32   ` [RFC v1 2/4] regulator: core: Add sysfs class backward compatibility Saravana Kannan
2023-02-22 17:47     ` Mark Brown
2023-02-18  8:32   ` Saravana Kannan [this message]
2023-02-22 17:50     ` [RFC v1 3/4] regulator: core: Probe regulator devices Mark Brown
2023-02-18  8:32   ` [RFC v1 4/4] regulator: core: Move regulator supply resolving to the probe function Saravana Kannan
2023-02-22 22:51     ` Mark Brown
2023-02-18  8:36   ` [RFC v1 0/4] Simplify regulator supply resolution code by offloading to driver core Saravana Kannan
2023-02-18  8:54   ` Greg Kroah-Hartman
2023-02-20  9:01   ` Marek Szyprowski
2023-02-21 22:36     ` Saravana Kannan
2023-02-21 22:52       ` Mark Brown
2023-02-22  3:13         ` Saravana Kannan
2023-02-22 14:54           ` Mark Brown
2023-02-22  7:15       ` Marek Szyprowski

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=20230218083252.2044423-4-saravanak@google.com \
    --to=saravanak@google.com \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=dianders@chromium.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-team@android.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=luca.weiss@fairphone.com \
    --cc=m.szyprowski@samsung.com \
    --cc=sudeep.holla@arm.com \
    --cc=tony@atomide.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