Skip to content

Commit eeebfe6

Browse files
t-8chBenjamin Tissoires
authored andcommitted
HID: rmi: remove #ifdef CONFIG_PM
Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be compiled, protecting against bitrot. The linker will then garbage-collect the unused function avoiding any overhead. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent fc25434 commit eeebfe6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/hid/hid-rmi.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ static void rmi_report(struct hid_device *hid, struct hid_report *report)
436436
input_sync(field->hidinput->input);
437437
}
438438

439-
#ifdef CONFIG_PM
440439
static int rmi_suspend(struct hid_device *hdev, pm_message_t message)
441440
{
442441
struct rmi_data *data = hid_get_drvdata(hdev);
@@ -483,7 +482,6 @@ static int rmi_post_resume(struct hid_device *hdev)
483482
hid_hw_close(hdev);
484483
return ret;
485484
}
486-
#endif /* CONFIG_PM */
487485

488486
static int rmi_hid_reset(struct rmi_transport_dev *xport, u16 reset_addr)
489487
{
@@ -774,11 +772,9 @@ static struct hid_driver rmi_driver = {
774772
.report = rmi_report,
775773
.input_mapping = rmi_input_mapping,
776774
.input_configured = rmi_input_configured,
777-
#ifdef CONFIG_PM
778-
.suspend = rmi_suspend,
779-
.resume = rmi_post_resume,
780-
.reset_resume = rmi_post_resume,
781-
#endif
775+
.suspend = pm_ptr(rmi_suspend),
776+
.resume = pm_ptr(rmi_post_resume),
777+
.reset_resume = pm_ptr(rmi_post_resume),
782778
};
783779

784780
module_hid_driver(rmi_driver);

0 commit comments

Comments
 (0)