Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: samsung-keypad - use devm to disable runtime PM

To make sure that runtime PM is disabled at the right time compared
to all other devm-managed resources use devm_pm_runtime_enable().

Link: https://lore.kernel.org/r/20240819045813.2154642-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+5 -12
+5 -12
drivers/input/keyboard/samsung-keypad.c
··· 420 420 421 421 device_init_wakeup(&pdev->dev, pdata->wakeup); 422 422 platform_set_drvdata(pdev, keypad); 423 - pm_runtime_enable(&pdev->dev); 423 + 424 + error = devm_pm_runtime_enable(&pdev->dev); 425 + if (error) 426 + return error; 424 427 425 428 error = input_register_device(keypad->input_dev); 426 429 if (error) 427 - goto err_disable_runtime_pm; 430 + return error; 428 431 429 432 if (pdev->dev.of_node) { 430 433 devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap); ··· 435 432 devm_kfree(&pdev->dev, (void *)pdata); 436 433 } 437 434 return 0; 438 - 439 - err_disable_runtime_pm: 440 - pm_runtime_disable(&pdev->dev); 441 - return error; 442 - } 443 - 444 - static void samsung_keypad_remove(struct platform_device *pdev) 445 - { 446 - pm_runtime_disable(&pdev->dev); 447 435 } 448 436 449 437 static int samsung_keypad_runtime_suspend(struct device *dev) ··· 569 575 570 576 static struct platform_driver samsung_keypad_driver = { 571 577 .probe = samsung_keypad_probe, 572 - .remove = samsung_keypad_remove, 573 578 .driver = { 574 579 .name = "samsung-keypad", 575 580 .of_match_table = of_match_ptr(samsung_keypad_dt_match),