Commit ef05e9b9 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull watchdog fixes from Wim Van Sebroeck:
 "This fixes some small errors in the new da9055 driver, eliminates a
  compiler warning and adds DT support for the twl4030_wdt driver (so
  that we can have multiple watchdogs with DT on the omap platforms)."

* git://www.linux-watchdog.org/linux-watchdog:
  watchdog: twl4030_wdt: add DT support
  watchdog: omap_wdt: eliminate unused variable and a compiler warning
  watchdog: da9055: Don't update wdt_dev->timeout in da9055_wdt_set_timeout error path
  watchdog: da9055: Fix invalid free of devm_ allocated data
parents 080a62e2 8899b8d9
Device tree bindings for twl4030-wdt driver (TWL4030 watchdog)
Required properties:
compatible = "ti,twl4030-wdt";
Example:
watchdog {
compatible = "ti,twl4030-wdt";
};
...@@ -19,6 +19,10 @@ rtc { ...@@ -19,6 +19,10 @@ rtc {
interrupts = <11>; interrupts = <11>;
}; };
watchdog {
compatible = "ti,twl4030-wdt";
};
vdac: regulator-vdac { vdac: regulator-vdac {
compatible = "ti,twl4030-vdac"; compatible = "ti,twl4030-vdac";
regulator-min-microvolt = <1800000>; regulator-min-microvolt = <1800000>;
......
...@@ -72,20 +72,21 @@ static int da9055_wdt_set_timeout(struct watchdog_device *wdt_dev, ...@@ -72,20 +72,21 @@ static int da9055_wdt_set_timeout(struct watchdog_device *wdt_dev,
DA9055_TWDSCALE_MASK, DA9055_TWDSCALE_MASK,
da9055_wdt_maps[i].reg_val << da9055_wdt_maps[i].reg_val <<
DA9055_TWDSCALE_SHIFT); DA9055_TWDSCALE_SHIFT);
if (ret < 0) if (ret < 0) {
dev_err(da9055->dev, dev_err(da9055->dev,
"Failed to update timescale bit, %d\n", ret); "Failed to update timescale bit, %d\n", ret);
return ret;
}
wdt_dev->timeout = timeout; wdt_dev->timeout = timeout;
return ret; return 0;
} }
static int da9055_wdt_ping(struct watchdog_device *wdt_dev) static int da9055_wdt_ping(struct watchdog_device *wdt_dev)
{ {
struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev); struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev);
struct da9055 *da9055 = driver_data->da9055; struct da9055 *da9055 = driver_data->da9055;
int ret;
/* /*
* We have a minimum time for watchdog window called TWDMIN. A write * We have a minimum time for watchdog window called TWDMIN. A write
...@@ -94,18 +95,12 @@ static int da9055_wdt_ping(struct watchdog_device *wdt_dev) ...@@ -94,18 +95,12 @@ static int da9055_wdt_ping(struct watchdog_device *wdt_dev)
mdelay(DA9055_TWDMIN); mdelay(DA9055_TWDMIN);
/* Reset the watchdog timer */ /* Reset the watchdog timer */
ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_E, return da9055_reg_update(da9055, DA9055_REG_CONTROL_E,
DA9055_WATCHDOG_MASK, 1); DA9055_WATCHDOG_MASK, 1);
return ret;
} }
static void da9055_wdt_release_resources(struct kref *r) static void da9055_wdt_release_resources(struct kref *r)
{ {
struct da9055_wdt_data *driver_data =
container_of(r, struct da9055_wdt_data, kref);
kfree(driver_data);
} }
static void da9055_wdt_ref(struct watchdog_device *wdt_dev) static void da9055_wdt_ref(struct watchdog_device *wdt_dev)
......
...@@ -296,7 +296,6 @@ static int omap_wdt_remove(struct platform_device *pdev) ...@@ -296,7 +296,6 @@ static int omap_wdt_remove(struct platform_device *pdev)
{ {
struct watchdog_device *wdog = platform_get_drvdata(pdev); struct watchdog_device *wdog = platform_get_drvdata(pdev);
struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog);
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pm_runtime_disable(wdev->dev); pm_runtime_disable(wdev->dev);
watchdog_unregister_device(wdog); watchdog_unregister_device(wdog);
......
...@@ -131,14 +131,21 @@ static int twl4030_wdt_resume(struct platform_device *pdev) ...@@ -131,14 +131,21 @@ static int twl4030_wdt_resume(struct platform_device *pdev)
#define twl4030_wdt_resume NULL #define twl4030_wdt_resume NULL
#endif #endif
static const struct of_device_id twl_wdt_of_match[] = {
{ .compatible = "ti,twl4030-wdt", },
{ },
};
MODULE_DEVICE_TABLE(of, twl_wdt_of_match);
static struct platform_driver twl4030_wdt_driver = { static struct platform_driver twl4030_wdt_driver = {
.probe = twl4030_wdt_probe, .probe = twl4030_wdt_probe,
.remove = twl4030_wdt_remove, .remove = twl4030_wdt_remove,
.suspend = twl4030_wdt_suspend, .suspend = twl4030_wdt_suspend,
.resume = twl4030_wdt_resume, .resume = twl4030_wdt_resume,
.driver = { .driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "twl4030_wdt", .name = "twl4030_wdt",
.of_match_table = twl_wdt_of_match,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment