diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-07-24 14:23:16 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2025-07-01 14:30:34 -0700 |
| commit | 5658439a5fc71272be9457b5028bdcd68c559b7a (patch) | |
| tree | 97b8fdf4da57ca3cd024996b24ff6f6ef81dc516 /drivers/input | |
| parent | Input: samsung-keypad - use struct_size() helper (diff) | |
| download | linux-5658439a5fc71272be9457b5028bdcd68c559b7a.tar.gz linux-5658439a5fc71272be9457b5028bdcd68c559b7a.zip | |
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>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/keyboard/samsung-keypad.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index e3a1b0db7ec8..d8eda10d63ee 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -420,11 +420,14 @@ static int samsung_keypad_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, pdata->wakeup); platform_set_drvdata(pdev, keypad); - pm_runtime_enable(&pdev->dev); + + error = devm_pm_runtime_enable(&pdev->dev); + if (error) + return error; error = input_register_device(keypad->input_dev); if (error) - goto err_disable_runtime_pm; + return error; if (pdev->dev.of_node) { devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap); @@ -432,15 +435,6 @@ static int samsung_keypad_probe(struct platform_device *pdev) devm_kfree(&pdev->dev, (void *)pdata); } return 0; - -err_disable_runtime_pm: - pm_runtime_disable(&pdev->dev); - return error; -} - -static void samsung_keypad_remove(struct platform_device *pdev) -{ - pm_runtime_disable(&pdev->dev); } static int samsung_keypad_runtime_suspend(struct device *dev) @@ -575,7 +569,6 @@ MODULE_DEVICE_TABLE(platform, samsung_keypad_driver_ids); static struct platform_driver samsung_keypad_driver = { .probe = samsung_keypad_probe, - .remove = samsung_keypad_remove, .driver = { .name = "samsung-keypad", .of_match_table = of_match_ptr(samsung_keypad_dt_match), |
