]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/base/core.c
clocksource: hyper-v: unexport __init-annotated hv_init_clocksource()
[mirror_ubuntu-jammy-kernel.git] / drivers / base / core.c
index 249da496581a0dac798502d32dc8ebf016a7c63c..8e73a34e10055595d38d1cf4e979efce399346e6 100644 (file)
@@ -485,8 +485,7 @@ static void device_link_release_fn(struct work_struct *work)
        /* Ensure that all references to the link object have been dropped. */
        device_link_synchronize_removal();
 
-       while (refcount_dec_not_one(&link->rpm_active))
-               pm_runtime_put(link->supplier);
+       pm_runtime_release_supplier(link, true);
 
        put_device(link->consumer);
        put_device(link->supplier);
@@ -821,9 +820,7 @@ struct device_link *device_link_add(struct device *consumer,
                     dev_bus_name(supplier), dev_name(supplier),
                     dev_bus_name(consumer), dev_name(consumer));
        if (device_register(&link->link_dev)) {
-               put_device(consumer);
-               put_device(supplier);
-               kfree(link);
+               put_device(&link->link_dev);
                link = NULL;
                goto out;
        }