aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/patches-4.4/011-3-fix-bld-errs-watchdog-da9055_wdt-Drop-reference-counting.patch
diff options
context:
space:
mode:
authorPavel Kubelun <be.dissent@gmail.com>2016-11-19 12:42:22 +0300
committerMathias Kresin <dev@kresin.me>2016-11-19 17:57:09 +0100
commit27c355f8a4faf13f438855259afbfd230f9e3a2b (patch)
treec0a8b5387e5ecc80d58d4657f56a7d0b00c1bf45 /target/linux/ipq806x/patches-4.4/011-3-fix-bld-errs-watchdog-da9055_wdt-Drop-reference-counting.patch
parent369317ce4873e3831cfed6aaf244025f41b569fc (diff)
downloadupstream-27c355f8a4faf13f438855259afbfd230f9e3a2b.tar.gz
upstream-27c355f8a4faf13f438855259afbfd230f9e3a2b.tar.bz2
upstream-27c355f8a4faf13f438855259afbfd230f9e3a2b.zip
ipq806x: fix build errors
Add missing patches that broke LEDE builder while updating WDT driver Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-4.4/011-3-fix-bld-errs-watchdog-da9055_wdt-Drop-reference-counting.patch')
-rw-r--r--target/linux/ipq806x/patches-4.4/011-3-fix-bld-errs-watchdog-da9055_wdt-Drop-reference-counting.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-4.4/011-3-fix-bld-errs-watchdog-da9055_wdt-Drop-reference-counting.patch b/target/linux/ipq806x/patches-4.4/011-3-fix-bld-errs-watchdog-da9055_wdt-Drop-reference-counting.patch
new file mode 100644
index 0000000000..3cf723a9bc
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.4/011-3-fix-bld-errs-watchdog-da9055_wdt-Drop-reference-counting.patch
@@ -0,0 +1,80 @@
+From 43f676ace2e0591718ff493d290bc49b35ec2ffc Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Fri, 25 Dec 2015 16:01:44 -0800
+Subject: watchdog: da9055_wdt: Drop reference counting
+
+Reference counting is now implemented in the watchdog core and no longer
+required in watchdog drivers.
+
+Since it was implememented a no-op, and since the local memory is allocated
+with devm_kzalloc(), the reference counting code in the driver really did
+not really work anyway, and this patch effectively fixes a bug which could
+cause a crash on unloading if the watchdog device was still open.
+
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
+---
+ drivers/watchdog/da9055_wdt.c | 24 ------------------------
+ 1 file changed, 24 deletions(-)
+
+--- a/drivers/watchdog/da9055_wdt.c
++++ b/drivers/watchdog/da9055_wdt.c
+@@ -35,7 +35,6 @@ MODULE_PARM_DESC(nowayout,
+ struct da9055_wdt_data {
+ struct watchdog_device wdt;
+ struct da9055 *da9055;
+- struct kref kref;
+ };
+
+ static const struct {
+@@ -99,24 +98,6 @@ static int da9055_wdt_ping(struct watchd
+ DA9055_WATCHDOG_MASK, 1);
+ }
+
+-static void da9055_wdt_release_resources(struct kref *r)
+-{
+-}
+-
+-static void da9055_wdt_ref(struct watchdog_device *wdt_dev)
+-{
+- struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev);
+-
+- kref_get(&driver_data->kref);
+-}
+-
+-static void da9055_wdt_unref(struct watchdog_device *wdt_dev)
+-{
+- struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev);
+-
+- kref_put(&driver_data->kref, da9055_wdt_release_resources);
+-}
+-
+ static int da9055_wdt_start(struct watchdog_device *wdt_dev)
+ {
+ return da9055_wdt_set_timeout(wdt_dev, wdt_dev->timeout);
+@@ -138,8 +119,6 @@ static const struct watchdog_ops da9055_
+ .stop = da9055_wdt_stop,
+ .ping = da9055_wdt_ping,
+ .set_timeout = da9055_wdt_set_timeout,
+- .ref = da9055_wdt_ref,
+- .unref = da9055_wdt_unref,
+ };
+
+ static int da9055_wdt_probe(struct platform_device *pdev)
+@@ -165,8 +144,6 @@ static int da9055_wdt_probe(struct platf
+ watchdog_set_nowayout(da9055_wdt, nowayout);
+ watchdog_set_drvdata(da9055_wdt, driver_data);
+
+- kref_init(&driver_data->kref);
+-
+ ret = da9055_wdt_stop(da9055_wdt);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Failed to stop watchdog, %d\n", ret);
+@@ -189,7 +166,6 @@ static int da9055_wdt_remove(struct plat
+ struct da9055_wdt_data *driver_data = platform_get_drvdata(pdev);
+
+ watchdog_unregister_device(&driver_data->wdt);
+- kref_put(&driver_data->kref, da9055_wdt_release_resources);
+
+ return 0;
+ }