[Topic DIscussion] 这两个是linux内核中什么驱动?谢谢
Tofloor
poster avatar
jiutian123
deepin
2022-05-28 19:23
Author

found driver: alarmtimer

found driver: reg-dummy

百度没查到求助tail

Reply Favorite View the author
All Replies
jiutian123
deepin
2022-05-28 19:47
#1

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

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);
Reply View the author