Skip to content

Commit

Permalink
common: reset_source: Introduce reset_source_name()
Browse files Browse the repository at this point in the history
Introduce reset_source_name() to get string representation of current
reset source.

Signed-off-by: Andrey Smirnov <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
  • Loading branch information
ndreys authored and saschahauer committed May 8, 2018
1 parent ccdc6ba commit 307da7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/reset_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ void reset_source_set_priority(enum reset_src_type st, unsigned int priority)
}
EXPORT_SYMBOL(reset_source_set_priority);

const char *reset_source_name(void)
{
return reset_src_names[reset_source];
}
EXPORT_SYMBOL(reset_source_name);

void reset_source_set_instance(enum reset_src_type type, int instance)
{
if (reset_source == type)
Expand Down
6 changes: 6 additions & 0 deletions include/reset_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum reset_src_type reset_source_get(void);
void reset_source_set_instance(enum reset_src_type type, int instance);
int reset_source_get_instance(void);
unsigned int of_get_reset_source_priority(struct device_node *node);
const char *reset_source_name(void);
#else
static inline void reset_source_set_priority(enum reset_src_type type,
unsigned int priority)
Expand All @@ -54,6 +55,11 @@ static inline unsigned int of_get_reset_source_priority(struct device_node *node
{
return 0;
}

static inline const char *reset_source_name(void)
{
return "unknown";
}
#endif

#define RESET_SOURCE_DEFAULT_PRIORITY 100
Expand Down

0 comments on commit 307da7d

Please sign in to comment.