010-3-watchdog-Add-action-and-data-parameters-to-restart-handler-callback.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. rom 4d8b229d5ea610affe672e919021e9d02cd877da Mon Sep 17 00:00:00 2001
  2. From: Guenter Roeck <linux@roeck-us.net>
  3. Date: Fri, 26 Feb 2016 17:32:49 -0800
  4. Subject: watchdog: Add 'action' and 'data' parameters to restart handler
  5. callback
  6. The 'action' (or restart mode) and data parameters may be used by restart
  7. handlers, so they should be passed to the restart callback functions.
  8. Cc: Sylvain Lemieux <slemieux@tycoint.com>
  9. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  10. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  11. ---
  12. drivers/watchdog/qcom-wdt.c | 3 ++-
  13. drivers/watchdog/watchdog_core.c | 2 +-
  14. include/linux/watchdog.h | 2 +-
  15. --- a/drivers/watchdog/qcom-wdt.c
  16. +++ b/drivers/watchdog/qcom-wdt.c
  17. @@ -70,7 +70,8 @@ static int qcom_wdt_set_timeout(struct w
  18. return qcom_wdt_start(wdd);
  19. }
  20. -static int qcom_wdt_restart(struct watchdog_device *wdd)
  21. +static int qcom_wdt_restart(struct watchdog_device *wdd, unsigned long action,
  22. + void *data)
  23. {
  24. struct qcom_wdt *wdt = to_qcom_wdt(wdd);
  25. u32 timeout;
  26. --- a/drivers/watchdog/watchdog_core.c
  27. +++ b/drivers/watchdog/watchdog_core.c
  28. @@ -164,7 +164,7 @@ static int watchdog_restart_notifier(str
  29. int ret;
  30. - ret = wdd->ops->restart(wdd);
  31. + ret = wdd->ops->restart(wdd, action, data);
  32. if (ret)
  33. return NOTIFY_BAD;
  34. --- a/include/linux/watchdog.h
  35. +++ b/include/linux/watchdog.h
  36. @@ -46,7 +46,7 @@ struct watchdog_ops {
  37. unsigned int (*status)(struct watchdog_device *);
  38. int (*set_timeout)(struct watchdog_device *, unsigned int);
  39. unsigned int (*get_timeleft)(struct watchdog_device *);
  40. - int (*restart)(struct watchdog_device *);
  41. + int (*restart)(struct watchdog_device *, unsigned long, void *);
  42. long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
  43. };