Unverified Commit 0eccea71 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Krzysztof Wilczyński
Browse files

PCI: vmd: Remove usage of the deprecated ida_simple_*() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove() functions.

This is also less verbose.

Link: https://lore.kernel.org/linux-pci/270f25cdc154f3b0309e57b2f6421776752e2170.1702230593.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
parent b85ea95d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -984,7 +984,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
		return -ENOMEM;

	vmd->dev = dev;
	vmd->instance = ida_simple_get(&vmd_instance_ida, 0, 0, GFP_KERNEL);
	vmd->instance = ida_alloc(&vmd_instance_ida, GFP_KERNEL);
	if (vmd->instance < 0)
		return vmd->instance;

@@ -1026,7 +1026,7 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
	return 0;

 out_release_instance:
	ida_simple_remove(&vmd_instance_ida, vmd->instance);
	ida_free(&vmd_instance_ida, vmd->instance);
	return err;
}

@@ -1048,7 +1048,7 @@ static void vmd_remove(struct pci_dev *dev)
	vmd_cleanup_srcu(vmd);
	vmd_detach_resources(vmd);
	vmd_remove_irq_domain(vmd);
	ida_simple_remove(&vmd_instance_ida, vmd->instance);
	ida_free(&vmd_instance_ida, vmd->instance);
}

static void vmd_shutdown(struct pci_dev *dev)