Messages in this thread Patch in this message | | | Date | Sat, 18 Feb 2023 00:32:50 -0800 | Subject | [RFC v1 3/4] regulator: core: Probe regulator devices | From | Saravana Kannan <> |
| |
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 = ®ulator_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(®ulator_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(®ulator_bus); unreg_compat: class_compat_unregister(regulator_compat_class); return ret; -- 2.39.2.637.g21b0678d19-goog
| |