Skip to content

Commit b3e5bcf

Browse files
hadessJiri Kosina
authored andcommitted
HID: hid-sensor-hub: Use pm_ptr instead of #ifdef CONFIG_PM
This increases build coverage and allows to drop an #ifdef. Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent c9b6616 commit b3e5bcf

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

drivers/hid/hid-sensor-hub.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
422422
}
423423
EXPORT_SYMBOL_GPL(sensor_hub_input_get_attribute_info);
424424

425-
#ifdef CONFIG_PM
426425
static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
427426
{
428427
struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
@@ -463,7 +462,6 @@ static int sensor_hub_reset_resume(struct hid_device *hdev)
463462
{
464463
return 0;
465464
}
466-
#endif
467465

468466
/*
469467
* Handle raw report as sent by device
@@ -772,11 +770,9 @@ static struct hid_driver sensor_hub_driver = {
772770
.remove = sensor_hub_remove,
773771
.raw_event = sensor_hub_raw_event,
774772
.report_fixup = sensor_hub_report_fixup,
775-
#ifdef CONFIG_PM
776-
.suspend = sensor_hub_suspend,
777-
.resume = sensor_hub_resume,
778-
.reset_resume = sensor_hub_reset_resume,
779-
#endif
773+
.suspend = pm_ptr(sensor_hub_suspend),
774+
.resume = pm_ptr(sensor_hub_resume),
775+
.reset_resume = pm_ptr(sensor_hub_reset_resume),
780776
};
781777
module_hid_driver(sensor_hub_driver);
782778

0 commit comments

Comments
 (0)