Skip to content

Commit e506d40

Browse files
thierryredingdavem330
authored andcommitted
net: dsa: Fix build warning for !PM_SLEEP
The dsa_switch_suspend() and dsa_switch_resume() functions are only used when PM_SLEEP is enabled, so they need #ifdef CONFIG_PM_SLEEP protection to avoid a compiler warning. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3c87dcb commit e506d40

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/dsa/dsa.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
238238
{
239239
}
240240

241+
#ifdef CONFIG_PM_SLEEP
241242
static int dsa_switch_suspend(struct dsa_switch *ds)
242243
{
243244
int i, ret = 0;
@@ -280,6 +281,7 @@ static int dsa_switch_resume(struct dsa_switch *ds)
280281

281282
return 0;
282283
}
284+
#endif
283285

284286

285287
/* link polling *************************************************************/

0 commit comments

Comments
 (0)