Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: da9063 - use devm_delayed_work_autocancel()

Use devm_delayed_work_autocancel() instead of hand-writing it.
This saves a few lines of code.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/a76ac3f4c7aee205395b89b5b3f587e30a48df96.1645205312.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Christophe JAILLET and committed by
Dmitry Torokhov
dfafa560 65de58c2

+3 -10
+3 -10
drivers/input/misc/da9063_onkey.c
··· 4 4 * Copyright (C) 2015 Dialog Semiconductor Ltd. 5 5 */ 6 6 7 + #include <linux/devm-helpers.h> 7 8 #include <linux/module.h> 8 9 #include <linux/errno.h> 9 10 #include <linux/input.h> ··· 183 182 return IRQ_HANDLED; 184 183 } 185 184 186 - static void da9063_cancel_poll(void *data) 187 - { 188 - struct da9063_onkey *onkey = data; 189 - 190 - cancel_delayed_work_sync(&onkey->work); 191 - } 192 - 193 185 static int da9063_onkey_probe(struct platform_device *pdev) 194 186 { 195 187 struct da9063_onkey *onkey; ··· 228 234 229 235 input_set_capability(onkey->input, EV_KEY, KEY_POWER); 230 236 231 - INIT_DELAYED_WORK(&onkey->work, da9063_poll_on); 232 - 233 - error = devm_add_action(&pdev->dev, da9063_cancel_poll, onkey); 237 + error = devm_delayed_work_autocancel(&pdev->dev, &onkey->work, 238 + da9063_poll_on); 234 239 if (error) { 235 240 dev_err(&pdev->dev, 236 241 "Failed to add cancel poll action: %d\n",