mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-17 05:00:11 +07:00
836856e3bd
The cw1200 uses #ifdef to check for CONFIG_PM, but then uses SIMPLE_DEV_PM_OPS, which leaves the references out when CONFIG_PM_SLEEP is not defined, so we get a warning with PM=y && PM_SLEEP=n: drivers/net/wireless/st/cw1200/cw1200_spi.c:450:12: error: 'cw1200_spi_suspend' defined but not used [-Werror=unused-function] This removes the incorrect #ifdef and instead uses a __maybe_unused annotation to let the compiler know it can silently drop the function definition. For the DEV_PM_OPS definition, we can use an IS_ENABLED() check to avoid defining the structure when CONFIG_PM is not set without the #ifdef. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
/*
|
|
* Mac80211 power management interface for ST-Ericsson CW1200 mac80211 drivers
|
|
*
|
|
* Copyright (c) 2011, ST-Ericsson
|
|
* Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#ifndef PM_H_INCLUDED
|
|
#define PM_H_INCLUDED
|
|
|
|
/* ******************************************************************** */
|
|
/* mac80211 API */
|
|
|
|
/* extern */ struct cw1200_common;
|
|
/* private */ struct cw1200_suspend_state;
|
|
|
|
struct cw1200_pm_state {
|
|
struct cw1200_suspend_state *suspend_state;
|
|
struct timer_list stay_awake;
|
|
struct platform_device *pm_dev;
|
|
spinlock_t lock; /* Protect access */
|
|
};
|
|
|
|
#ifdef CONFIG_PM
|
|
int cw1200_pm_init(struct cw1200_pm_state *pm,
|
|
struct cw1200_common *priv);
|
|
void cw1200_pm_deinit(struct cw1200_pm_state *pm);
|
|
int cw1200_wow_suspend(struct ieee80211_hw *hw,
|
|
struct cfg80211_wowlan *wowlan);
|
|
int cw1200_can_suspend(struct cw1200_common *priv);
|
|
int cw1200_wow_resume(struct ieee80211_hw *hw);
|
|
void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
|
|
unsigned long tmo);
|
|
#else
|
|
static inline void cw1200_pm_stay_awake(struct cw1200_pm_state *pm,
|
|
unsigned long tmo)
|
|
{
|
|
}
|
|
static inline int cw1200_can_suspend(struct cw1200_common *priv)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
#endif
|