From: Armin Wolf <W_Armin@gmx.de>
To: jdelvare@suse.com, linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] hwmon: (ftsteutates) Use devm_watchdog_register_device()
Date: Sat, 24 Dec 2022 05:18:55 +0100 [thread overview]
Message-ID: <20221224041855.83981-4-W_Armin@gmx.de> (raw)
In-Reply-To: <20221224041855.83981-1-W_Armin@gmx.de>
Use devm_watchdog_register_device() to let devres take care
of unregistering the watchdog at device removal. Remove the
now pointless fts_remove() function.
Tested on a Fujitsu DS3401-B1.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/hwmon/ftsteutates.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/hwmon/ftsteutates.c b/drivers/hwmon/ftsteutates.c
index 66ff8d69a0de..d8878b8d16bc 100644
--- a/drivers/hwmon/ftsteutates.c
+++ b/drivers/hwmon/ftsteutates.c
@@ -333,7 +333,7 @@ static int fts_watchdog_init(struct fts_data *data)
/* max timeout 255 minutes. */
data->wdd.max_hw_heartbeat_ms = 0xFF * 60 * MSEC_PER_SEC;
- return watchdog_register_device(&data->wdd);
+ return devm_watchdog_register_device(&data->client->dev, &data->wdd);
}
static umode_t fts_is_visible(const void *devdata, enum hwmon_sensor_types type, u32 attr,
@@ -611,13 +611,6 @@ static int fts_detect(struct i2c_client *client,
return 0;
}
-static void fts_remove(struct i2c_client *client)
-{
- struct fts_data *data = dev_get_drvdata(&client->dev);
-
- watchdog_unregister_device(&data->wdd);
-}
-
static int fts_probe(struct i2c_client *client)
{
u8 revision;
@@ -684,7 +677,6 @@ static struct i2c_driver fts_driver = {
},
.id_table = fts_id,
.probe_new = fts_probe,
- .remove = fts_remove,
.detect = fts_detect,
.address_list = normal_i2c,
};
--
2.30.2
next prev parent reply other threads:[~2022-12-24 4:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-24 4:18 [PATCH 0/3] hwmon: (ftsteutates) Various fixes Armin Wolf
2022-12-24 4:18 ` [PATCH 1/3] hwmon: (ftsteutates) Fix scaling of measurements Armin Wolf
2022-12-29 14:26 ` Guenter Roeck
2022-12-24 4:18 ` [PATCH 2/3] hwmon: (ftsteutates) Convert to devm_hwmon_device_register_with_info() Armin Wolf
2022-12-24 15:18 ` Guenter Roeck
2022-12-31 11:40 ` Armin Wolf
2022-12-31 14:52 ` Guenter Roeck
2022-12-24 4:18 ` Armin Wolf [this message]
2022-12-29 14:29 ` [PATCH 3/3] hwmon: (ftsteutates) Use devm_watchdog_register_device() Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221224041855.83981-4-W_Armin@gmx.de \
--to=w_armin@gmx.de \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®