1 From 3b8d058cfe6a3b14abee324f4c4b33e64bf61aeb Mon Sep 17 00:00:00 2001
2 From: Guenter Roeck <linux@roeck-us.net>
3 Date: Fri, 25 Dec 2015 16:01:45 -0800
4 Subject: hwmon: (sch56xx) Drop watchdog driver data reference count callbacks
6 Reference counting is now implemented in the watchdog core and no longer
7 required in watchdog drivers.
9 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
10 Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
12 drivers/hwmon/sch56xx-common.c | 31 +------------------------------
13 1 file changed, 1 insertion(+), 30 deletions(-)
15 --- a/drivers/hwmon/sch56xx-common.c
16 +++ b/drivers/hwmon/sch56xx-common.c
18 #include <linux/watchdog.h>
19 #include <linux/miscdevice.h>
20 #include <linux/uaccess.h>
21 -#include <linux/kref.h>
22 #include <linux/slab.h>
23 #include "sch56xx-common.h"
25 @@ -67,7 +66,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog can
26 struct sch56xx_watchdog_data {
28 struct mutex *io_lock;
30 struct watchdog_info wdinfo;
31 struct watchdog_device wddev;
33 @@ -258,15 +256,6 @@ EXPORT_SYMBOL(sch56xx_read_virtual_reg12
37 -/* Release our data struct when we're unregistered *and*
38 - all references to our watchdog device are released */
39 -static void watchdog_release_resources(struct kref *r)
41 - struct sch56xx_watchdog_data *data =
42 - container_of(r, struct sch56xx_watchdog_data, kref);
46 static int watchdog_set_timeout(struct watchdog_device *wddev,
49 @@ -395,28 +384,12 @@ static int watchdog_stop(struct watchdog
53 -static void watchdog_ref(struct watchdog_device *wddev)
55 - struct sch56xx_watchdog_data *data = watchdog_get_drvdata(wddev);
57 - kref_get(&data->kref);
60 -static void watchdog_unref(struct watchdog_device *wddev)
62 - struct sch56xx_watchdog_data *data = watchdog_get_drvdata(wddev);
64 - kref_put(&data->kref, watchdog_release_resources);
67 static const struct watchdog_ops watchdog_ops = {
69 .start = watchdog_start,
70 .stop = watchdog_stop,
71 .ping = watchdog_trigger,
72 .set_timeout = watchdog_set_timeout,
73 - .ref = watchdog_ref,
74 - .unref = watchdog_unref,
77 struct sch56xx_watchdog_data *sch56xx_watchdog_register(struct device *parent,
78 @@ -448,7 +421,6 @@ struct sch56xx_watchdog_data *sch56xx_wa
81 data->io_lock = io_lock;
82 - kref_init(&data->kref);
84 strlcpy(data->wdinfo.identity, "sch56xx watchdog",
85 sizeof(data->wdinfo.identity));
86 @@ -494,8 +466,7 @@ EXPORT_SYMBOL(sch56xx_watchdog_register)
87 void sch56xx_watchdog_unregister(struct sch56xx_watchdog_data *data)
89 watchdog_unregister_device(&data->wddev);
90 - kref_put(&data->kref, watchdog_release_resources);
91 - /* Don't touch data after this it may have been free-ed! */
94 EXPORT_SYMBOL(sch56xx_watchdog_unregister);