#include <linux/auxiliary_bus.h>
 #include <linux/bitfield.h>
 #include <linux/bitops.h>
+#include <linux/devm-helpers.h>
 #include <linux/hwmon.h>
 #include <linux/jiffies.h>
 #include <linux/module.h>
                dev_err(priv->dev, "Failed to populate DIMM temp info\n");
 }
 
-static void remove_delayed_work(void *_priv)
-{
-       struct peci_dimmtemp *priv = _priv;
-
-       cancel_delayed_work_sync(&priv->detect_work);
-}
-
 static int peci_dimmtemp_probe(struct auxiliary_device *adev, const struct auxiliary_device_id *id)
 {
        struct device *dev = &adev->dev;
                         "Unexpected PECI revision %#x, some features may be unavailable\n",
                         peci_dev->info.peci_revision);
 
-       INIT_DELAYED_WORK(&priv->detect_work, create_dimm_temp_info_delayed);
-
-       ret = devm_add_action_or_reset(priv->dev, remove_delayed_work, priv);
+       ret = devm_delayed_work_autocancel(priv->dev, &priv->detect_work,
+                                          create_dimm_temp_info_delayed);
        if (ret)
                return ret;