diff options
author | Armin Wolf <W_Armin@gmx.de> | 2022-12-24 07:18:55 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-02-03 18:30:09 +0300 |
commit | e1515a749276efeff18b091f3367c3e4640ad497 (patch) | |
tree | 9fc1ec627ade548d2d59a189aee0324360d496fd | |
parent | ebd4bfee2b972d34a2f72f81767d0cf47e6c914b (diff) | |
download | linux-e1515a749276efeff18b091f3367c3e4640ad497.tar.xz |
hwmon: (ftsteutates) Use devm_watchdog_register_device()
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>
Link: https://lore.kernel.org/r/20221224041855.83981-4-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/ftsteutates.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/hwmon/ftsteutates.c b/drivers/hwmon/ftsteutates.c index ffa0bb364877..e860924f90aa 100644 --- a/drivers/hwmon/ftsteutates.c +++ b/drivers/hwmon/ftsteutates.c @@ -337,7 +337,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); } /*****************************************************************************/ @@ -751,13 +751,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; @@ -826,7 +819,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, }; |