]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
platform/x86/intel/vsec: Remove a useless mutex
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 2 Nov 2024 15:59:41 +0000 (16:59 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 4 Nov 2024 13:04:34 +0000 (15:04 +0200)
ida_alloc()/ida_free() don't need any mutex, so remove this one.

It was introduced by commit 9a90ea7d3784 ("platform/x86/intel/vsec: Use
mutex for ida_alloc() and ida_free()").

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/ccc08a262304f7f8c2e435349f0f714ebf9acfcd.1730563031.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/vsec.c

index 7b5cc9993974ef8de67dede19232e1ce355bbe2d..9e0f8e38178c2abf84139f488f6515133b656f44 100644 (file)
@@ -79,17 +79,13 @@ static void intel_vsec_remove_aux(void *data)
        auxiliary_device_uninit(data);
 }
 
-static DEFINE_MUTEX(vsec_ida_lock);
-
 static void intel_vsec_dev_release(struct device *dev)
 {
        struct intel_vsec_device *intel_vsec_dev = dev_to_ivdev(dev);
 
        xa_erase(&auxdev_array, intel_vsec_dev->id);
 
-       mutex_lock(&vsec_ida_lock);
        ida_free(intel_vsec_dev->ida, intel_vsec_dev->auxdev.id);
-       mutex_unlock(&vsec_ida_lock);
 
        kfree(intel_vsec_dev->resource);
        kfree(intel_vsec_dev);
@@ -113,9 +109,7 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
                return ret;
        }
 
-       mutex_lock(&vsec_ida_lock);
        id = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
-       mutex_unlock(&vsec_ida_lock);
        if (id < 0) {
                xa_erase(&auxdev_array, intel_vsec_dev->id);
                kfree(intel_vsec_dev->resource);