Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbbLTVFs (ORCPT ); Sun, 20 Dec 2015 16:05:48 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:60026 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbbLTVFT (ORCPT ); Sun, 20 Dec 2015 16:05:19 -0500 From: Guenter Roeck To: linux-watchdog@vger.kernel.org Cc: Wim Van Sebroeck , Pratyush Anand , Hans de Goede , Damien Riegel , linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 5/5] hwmon: (sch56xx) Drop watchdog driver data reference count callbacks Date: Sun, 20 Dec 2015 13:05:03 -0800 Message-Id: <1450645503-16661-6-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450645503-16661-1-git-send-email-linux@roeck-us.net> References: <1450645503-16661-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3032 Lines: 98 Reference counting is now implemented in the watchdog core and no longer required in watchdog drivers. Signed-off-by: Guenter Roeck --- drivers/hwmon/sch56xx-common.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c index 738681983284..88dba68a9abb 100644 --- a/drivers/hwmon/sch56xx-common.c +++ b/drivers/hwmon/sch56xx-common.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #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,6 @@ 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! */ } EXPORT_SYMBOL(sch56xx_watchdog_unregister); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/