Skip to content

Commit

Permalink
spi: tegra20-slink: Declare runtime suspend and resume functions cond…
Browse files Browse the repository at this point in the history
…itionally

The following build error is seen with CONFIG_PM=n.

drivers/spi/spi-tegra20-slink.c:1188:12: error:
	'tegra_slink_runtime_suspend' defined but not used
drivers/spi/spi-tegra20-slink.c:1200:12: error:
	'tegra_slink_runtime_resume' defined but not used

Declare the functions only if PM is enabled. While at it, remove the
unnecessary forward declarations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210907045358.2138282-1-linux@roeck-us.net
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Guenter Roeck authored and Mark Brown committed Sep 9, 2021
1 parent 5457773 commit 2bab940
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/spi/spi-tegra20-slink.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ struct tegra_slink_data {
struct dma_async_tx_descriptor *tx_dma_desc;
};

static int tegra_slink_runtime_suspend(struct device *dev);
static int tegra_slink_runtime_resume(struct device *dev);

static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi,
unsigned long reg)
{
Expand Down Expand Up @@ -1185,6 +1182,7 @@ static int tegra_slink_resume(struct device *dev)
}
#endif

#ifdef CONFIG_PM
static int tegra_slink_runtime_suspend(struct device *dev)
{
struct spi_master *master = dev_get_drvdata(dev);
Expand All @@ -1210,6 +1208,7 @@ static int tegra_slink_runtime_resume(struct device *dev)
}
return 0;
}
#endif /* CONFIG_PM */

static const struct dev_pm_ops slink_pm_ops = {
SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,
Expand Down

0 comments on commit 2bab940

Please sign in to comment.