Skip to content

Commit

Permalink
sprd_serial: compile sprd_suspend and sprd_resume conditionally
Browse files Browse the repository at this point in the history
Building sprd_serial.o when CONFIG_PM_SLEEP is not defined triggers
these warnings:
    drivers/tty/serial/sprd_serial.c:755:12: warning: ‘sprd_suspend’ defined but not used [-Wunused-function]
     static int sprd_suspend(struct device *dev)
                ^
    drivers/tty/serial/sprd_serial.c:764:12: warning: ‘sprd_resume’ defined but not used [-Wunused-function]
     static int sprd_resume(struct device *dev)
                ^

Let's compile these functions only when CONFIG_PM_SLEEP is defined.

Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
pebolle authored and gregkh committed Mar 7, 2015
1 parent ad3d4fd commit b51e3f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/tty/serial/sprd_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ static int sprd_probe(struct platform_device *pdev)
return ret;
}

#ifdef CONFIG_PM_SLEEP
static int sprd_suspend(struct device *dev)
{
struct sprd_uart_port *sup = dev_get_drvdata(dev);
Expand All @@ -769,6 +770,7 @@ static int sprd_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(sprd_pm_ops, sprd_suspend, sprd_resume);

Expand Down

0 comments on commit b51e3f5

Please sign in to comment.