summaryrefslogtreecommitdiff
path: root/include/linux/watchdog.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-01-03 15:11:56 -0800
committerWim Van Sebroeck <wim@iguana.be>2016-01-11 21:53:57 +0100
commitfaa584757b63aad42d19f1c6a6eac2c848618f83 (patch)
treeb052c3091b4e14fbbb681d6eee5ad17d97267c3b /include/linux/watchdog.h
parent62cd1c40ce1c7c16835b599751c7a002eb5bbdf5 (diff)
watchdog: Add support for creating driver specific sysfs attributes
The Zodiac watchdog driver attaches additional sysfs attributes to the watchdog device. This has a number of problems: The watchdog device lifetime differs from the driver lifetime, and the device structure should therefore not be accessed from drivers. Also, creating sysfs attributes after driver registration results in a potential race condition if user space expects the attributes to exist but they don't exist yet. Add support for creating driver specific sysfs attributes to the watchdog core to solve the problems. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'include/linux/watchdog.h')
-rw-r--r--include/linux/watchdog.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index aaabd4703b46..076df50ea0da 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -55,6 +55,8 @@ struct watchdog_ops {
* @id: The watchdog's ID. (Allocated by watchdog_register_device)
* @dev: The device for our watchdog
* @parent: The parent bus device
+ * @groups: List of sysfs attribute groups to create when creating the
+ * watchdog device.
* @info: Pointer to a watchdog_info structure.
* @ops: Pointer to the list of watchdog operations.
* @bootstatus: Status of the watchdog device at boot.
@@ -82,6 +84,7 @@ struct watchdog_device {
int id;
struct device *dev;
struct device *parent;
+ const struct attribute_group **groups;
const struct watchdog_info *info;
const struct watchdog_ops *ops;
unsigned int bootstatus;