Merge git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:
 "This adds following items:

   - watchdog restart handler support
   - watchdog reboot notifier support
   - watchdog sysfs attributes
   - support for the following new devices: AMD Mullins platform, AMD
     Carrizo platform, meson8b SoC, CSRatlas7, TS-4800, Alphascale
     asm9260-wdt, Zodiac, Sigma Designs SMP86xx/SMP87xx
   - Changes in refcounting for the watchdog core
   - watchdog core improvements
   - and small fixes"

* git://www.linux-watchdog.org/linux-watchdog: (60 commits)
  watchdog: asm9260: remove __init and __exit annotations
  watchdog: Drop pointer to watchdog device from struct watchdog_device
  watchdog: ziirave: Use watchdog infrastructure to create sysfs attributes
  watchdog: Add support for creating driver specific sysfs attributes
  watchdog: kill unref/ref ops
  watchdog: stmp3xxx: Remove unused variables
  watchdog: add MT7621 watchdog support
  hwmon: (sch56xx) Drop watchdog driver data reference count callbacks
  watchdog: da9055_wdt: Drop reference counting
  watchdog: da9052_wdt: Drop reference counting
  watchdog: Separate and maintain variables based on variable lifetime
  watchdog: diag288: Stop re-using watchdog core internal flags
  watchdog: Create watchdog device in watchdog_dev.c
  watchdog: qcom-wdt: Do not set 'dev' in struct watchdog_device
  watchdog: mena21: Do not use device pointer from struct watchdog_device
  watchdog: gpio: Do not use device pointer from struct watchdog_device
  watchdog: tangox: Print info message using pointer to platform device
  watchdog: bcm2835_wdt: Drop log message if watchdog is stopped
  devicetree: watchdog: add binding for Sigma Designs SMP8642 watchdog
  watchdog: add support for Sigma Designs SMP86xx/SMP87xx
  ...
This commit is contained in:
Linus Torvalds 2016-01-17 12:15:38 -08:00
commit 6606b342fe
48 changed files with 2671 additions and 815 deletions

View file

@ -30,7 +30,6 @@
#include <linux/watchdog.h>
#include <linux/miscdevice.h>
#include <linux/uaccess.h>
#include <linux/kref.h>
#include <linux/slab.h>
#include "sch56xx-common.h"
@ -67,7 +66,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
struct sch56xx_watchdog_data {
u16 addr;
struct mutex *io_lock;
struct kref kref;
struct watchdog_info wdinfo;
struct watchdog_device wddev;
u8 watchdog_preset;
@ -258,15 +256,6 @@ EXPORT_SYMBOL(sch56xx_read_virtual_reg12);
* Watchdog routines
*/
/* Release our data struct when we're unregistered *and*
all references to our watchdog device are released */
static void watchdog_release_resources(struct kref *r)
{
struct sch56xx_watchdog_data *data =
container_of(r, struct sch56xx_watchdog_data, kref);
kfree(data);
}
static int watchdog_set_timeout(struct watchdog_device *wddev,
unsigned int timeout)
{
@ -395,28 +384,12 @@ static int watchdog_stop(struct watchdog_device *wddev)
return 0;
}
static void watchdog_ref(struct watchdog_device *wddev)
{
struct sch56xx_watchdog_data *data = watchdog_get_drvdata(wddev);
kref_get(&data->kref);
}
static void watchdog_unref(struct watchdog_device *wddev)
{
struct sch56xx_watchdog_data *data = watchdog_get_drvdata(wddev);
kref_put(&data->kref, watchdog_release_resources);
}
static const struct watchdog_ops watchdog_ops = {
.owner = THIS_MODULE,
.start = watchdog_start,
.stop = watchdog_stop,
.ping = watchdog_trigger,
.set_timeout = watchdog_set_timeout,
.ref = watchdog_ref,
.unref = watchdog_unref,
};
struct sch56xx_watchdog_data *sch56xx_watchdog_register(struct device *parent,
@ -448,7 +421,6 @@ struct sch56xx_watchdog_data *sch56xx_watchdog_register(struct device *parent,
data->addr = addr;
data->io_lock = io_lock;
kref_init(&data->kref);
strlcpy(data->wdinfo.identity, "sch56xx watchdog",
sizeof(data->wdinfo.identity));
@ -494,8 +466,7 @@ EXPORT_SYMBOL(sch56xx_watchdog_register);
void sch56xx_watchdog_unregister(struct sch56xx_watchdog_data *data)
{
watchdog_unregister_device(&data->wddev);
kref_put(&data->kref, watchdog_release_resources);
/* Don't touch data after this it may have been free-ed! */
kfree(data);
}
EXPORT_SYMBOL(sch56xx_watchdog_unregister);