Skip to content

Commit

Permalink
net: dsa: Export suspend/resume functions
Browse files Browse the repository at this point in the history
In preparation for allowing switch drivers to implement system-wide
suspend/resume functions, export dsa_switch_suspend and
dsa_switch_resume() such that these are callable from the appropriate
driver specific suspend/resume functions.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Aug 20, 2016
1 parent 0ae940c commit ea825e7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,18 @@ static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)

void dsa_unregister_switch(struct dsa_switch *ds);
int dsa_register_switch(struct dsa_switch *ds, struct device_node *np);
#ifdef CONFIG_PM_SLEEP
int dsa_switch_suspend(struct dsa_switch *ds);
int dsa_switch_resume(struct dsa_switch *ds);
#else
static inline int dsa_switch_suspend(struct dsa_switch *ds)
{
return 0;
}
static inline int dsa_switch_resume(struct dsa_switch *ds)
{
return 0;
}
#endif /* CONFIG_PM_SLEEP */

#endif
6 changes: 4 additions & 2 deletions net/dsa/dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
}

#ifdef CONFIG_PM_SLEEP
static int dsa_switch_suspend(struct dsa_switch *ds)
int dsa_switch_suspend(struct dsa_switch *ds)
{
int i, ret = 0;

Expand All @@ -562,8 +562,9 @@ static int dsa_switch_suspend(struct dsa_switch *ds)

return ret;
}
EXPORT_SYMBOL_GPL(dsa_switch_suspend);

static int dsa_switch_resume(struct dsa_switch *ds)
int dsa_switch_resume(struct dsa_switch *ds)
{
int i, ret = 0;

Expand All @@ -585,6 +586,7 @@ static int dsa_switch_resume(struct dsa_switch *ds)

return 0;
}
EXPORT_SYMBOL_GPL(dsa_switch_resume);
#endif

/* platform driver init and cleanup *****************************************/
Expand Down

0 comments on commit ea825e7

Please sign in to comment.