watchdog: pretimeout: add pretimeout_available_governors attribute
The change adds an option to a user with CONFIG_WATCHDOG_SYSFS and CONFIG_WATCHDOG_PRETIMEOUT_GOV enabled to get information about all registered watchdog pretimeout governors by reading watchdog device attribute named "pretimeout_available_governors". Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:

committed by
Wim Van Sebroeck

parent
53f96cee1a
commit
89873a711d
@@ -52,6 +52,21 @@ static struct governor_priv *find_governor_by_name(const char *gov_name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int watchdog_pretimeout_available_governors_get(char *buf)
|
||||
{
|
||||
struct governor_priv *priv;
|
||||
int count = 0;
|
||||
|
||||
mutex_lock(&governor_lock);
|
||||
|
||||
list_for_each_entry(priv, &governor_list, entry)
|
||||
count += sprintf(buf + count, "%s\n", priv->gov->name);
|
||||
|
||||
mutex_unlock(&governor_lock);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int watchdog_pretimeout_governor_get(struct watchdog_device *wdd, char *buf)
|
||||
{
|
||||
int count = 0;
|
||||
|
Reference in New Issue
Block a user