Skip to content

Commit ef05e9b

Browse files
committed
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
2 parents 080a62e + 8899b8d commit ef05e9b

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Device tree bindings for twl4030-wdt driver (TWL4030 watchdog)
2+
3+
Required properties:
4+
compatible = "ti,twl4030-wdt";
5+
6+
Example:
7+
8+
watchdog {
9+
compatible = "ti,twl4030-wdt";
10+
};

arch/arm/boot/dts/twl4030.dtsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
interrupts = <11>;
2020
};
2121

22+
watchdog {
23+
compatible = "ti,twl4030-wdt";
24+
};
25+
2226
vdac: regulator-vdac {
2327
compatible = "ti,twl4030-vdac";
2428
regulator-min-microvolt = <1800000>;

drivers/watchdog/da9055_wdt.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,21 @@ static int da9055_wdt_set_timeout(struct watchdog_device *wdt_dev,
7272
DA9055_TWDSCALE_MASK,
7373
da9055_wdt_maps[i].reg_val <<
7474
DA9055_TWDSCALE_SHIFT);
75-
if (ret < 0)
75+
if (ret < 0) {
7676
dev_err(da9055->dev,
7777
"Failed to update timescale bit, %d\n", ret);
78+
return ret;
79+
}
7880

7981
wdt_dev->timeout = timeout;
8082

81-
return ret;
83+
return 0;
8284
}
8385

8486
static int da9055_wdt_ping(struct watchdog_device *wdt_dev)
8587
{
8688
struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev);
8789
struct da9055 *da9055 = driver_data->da9055;
88-
int ret;
8990

9091
/*
9192
* 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)
9495
mdelay(DA9055_TWDMIN);
9596

9697
/* Reset the watchdog timer */
97-
ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_E,
98-
DA9055_WATCHDOG_MASK, 1);
99-
100-
return ret;
98+
return da9055_reg_update(da9055, DA9055_REG_CONTROL_E,
99+
DA9055_WATCHDOG_MASK, 1);
101100
}
102101

103102
static void da9055_wdt_release_resources(struct kref *r)
104103
{
105-
struct da9055_wdt_data *driver_data =
106-
container_of(r, struct da9055_wdt_data, kref);
107-
108-
kfree(driver_data);
109104
}
110105

111106
static void da9055_wdt_ref(struct watchdog_device *wdt_dev)

drivers/watchdog/omap_wdt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ static int omap_wdt_remove(struct platform_device *pdev)
296296
{
297297
struct watchdog_device *wdog = platform_get_drvdata(pdev);
298298
struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog);
299-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
300299

301300
pm_runtime_disable(wdev->dev);
302301
watchdog_unregister_device(wdog);

drivers/watchdog/twl4030_wdt.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,21 @@ static int twl4030_wdt_resume(struct platform_device *pdev)
131131
#define twl4030_wdt_resume NULL
132132
#endif
133133

134+
static const struct of_device_id twl_wdt_of_match[] = {
135+
{ .compatible = "ti,twl4030-wdt", },
136+
{ },
137+
};
138+
MODULE_DEVICE_TABLE(of, twl_wdt_of_match);
139+
134140
static struct platform_driver twl4030_wdt_driver = {
135141
.probe = twl4030_wdt_probe,
136142
.remove = twl4030_wdt_remove,
137143
.suspend = twl4030_wdt_suspend,
138144
.resume = twl4030_wdt_resume,
139145
.driver = {
140-
.owner = THIS_MODULE,
141-
.name = "twl4030_wdt",
146+
.owner = THIS_MODULE,
147+
.name = "twl4030_wdt",
148+
.of_match_table = twl_wdt_of_match,
142149
},
143150
};
144151

0 commit comments

Comments
 (0)