Skip to content

Commit

Permalink
mfd: intel-lpss: Hide suspend/resume functions in #ifdef
Browse files Browse the repository at this point in the history
When CONFIG_PM is disabled, the prototypes for these two functions
are not visible:

drivers/mfd/intel-lpss.c:482:5: error: no previous prototype for 'intel_lpss_suspend' [-Werror=missing-prototypes]
  482 | int intel_lpss_suspend(struct device *dev)
      |     ^~~~~~~~~~~~~~~~~~
drivers/mfd/intel-lpss.c:503:5: error: no previous prototype for 'intel_lpss_resume' [-Werror=missing-prototypes]
  503 | int intel_lpss_resume(struct device *dev)

Add the same #ifdef around the definition of the unused functions,
which avoids the warning and slightly reduces the code size.

Signed-off-by: Arnd Bergmann <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
arndb authored and lag-linaro committed Jun 15, 2023
1 parent e83152a commit 9ef18aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mfd/intel-lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ void intel_lpss_remove(struct device *dev)
}
EXPORT_SYMBOL_GPL(intel_lpss_remove);

#ifdef CONFIG_PM
static int resume_lpss_device(struct device *dev, void *data)
{
if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND))
Expand Down Expand Up @@ -514,6 +515,7 @@ int intel_lpss_resume(struct device *dev)
return 0;
}
EXPORT_SYMBOL_GPL(intel_lpss_resume);
#endif

static int __init intel_lpss_init(void)
{
Expand Down

0 comments on commit 9ef18aa

Please sign in to comment.