All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: dummy: Use devm_regulator_register()
@ 2021-09-25  3:55 Zenghui Yu
  2021-09-27 17:45 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Zenghui Yu @ 2021-09-25  3:55 UTC (permalink / raw)
  To: lgirdwood, broonie; +Cc: linux-kernel, wanghaibin.wang, Zenghui Yu

debugfs code complained at boot time that

  debugfs: Directory 'reg-dummy-regulator-dummy' with parent 'regulator'
  already present!

if we compile kernel with DEBUG_TEST_DRIVER_REMOVE. The problem is that we
don't provide .remove() method for dummy_regulator_driver, which should
invoke regulator_unregister() on device teardown to properly free things.

Though it's harmless as dummy_pdev never gets unbound in practice, let's
use devm_regulator_register() to get rid of the inconsistency.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
 drivers/regulator/dummy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/dummy.c b/drivers/regulator/dummy.c
index d8059f596391..24e586f93855 100644
--- a/drivers/regulator/dummy.c
+++ b/drivers/regulator/dummy.c
@@ -45,7 +45,8 @@ static int dummy_regulator_probe(struct platform_device *pdev)
 	config.dev = &pdev->dev;
 	config.init_data = &dummy_initdata;
 
-	dummy_regulator_rdev = regulator_register(&dummy_desc, &config);
+	dummy_regulator_rdev = devm_regulator_register(&pdev->dev, &dummy_desc,
+						       &config);
 	if (IS_ERR(dummy_regulator_rdev)) {
 		ret = PTR_ERR(dummy_regulator_rdev);
 		pr_err("Failed to register regulator: %d\n", ret);
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: dummy: Use devm_regulator_register()
  2021-09-25  3:55 [PATCH] regulator: dummy: Use devm_regulator_register() Zenghui Yu
@ 2021-09-27 17:45 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-09-27 17:45 UTC (permalink / raw)
  To: lgirdwood, Zenghui Yu; +Cc: Mark Brown, linux-kernel, wanghaibin.wang

On Sat, 25 Sep 2021 11:55:07 +0800, Zenghui Yu wrote:
> debugfs code complained at boot time that
> 
>   debugfs: Directory 'reg-dummy-regulator-dummy' with parent 'regulator'
>   already present!
> 
> if we compile kernel with DEBUG_TEST_DRIVER_REMOVE. The problem is that we
> don't provide .remove() method for dummy_regulator_driver, which should
> invoke regulator_unregister() on device teardown to properly free things.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator: dummy: Use devm_regulator_register()
      commit: c6e5e92cb29eab3e49dab444730b4ac200caaacb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-27 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-25  3:55 [PATCH] regulator: dummy: Use devm_regulator_register() Zenghui Yu
2021-09-27 17:45 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.