Thread (17 messages) read the whole thread 17 messages, 7 authors, 2021-03-18

Re: [PATCH v2 03/14] vfio: Split creation of a vfio_device into init and register ops

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-03-16 13:35:00
Also in: kvm

On Tue, Mar 16, 2021 at 07:55:11AM +0000, Tian, Kevin wrote:
quoted
+void *vfio_del_group_dev(struct device *dev)
+{
+	struct vfio_device *device = dev_get_drvdata(dev);
+	void *device_data = device->device_data;
+
+	vfio_unregister_group_dev(device);
 	dev_set_drvdata(dev, NULL);
Move to vfio_unregister_group_dev? In the cover letter you mentioned
that drvdata is managed by the driver but removed from the core. 
"removed from the core" means the core code doesn't touch drvdata at
all.
Looks it's also the rule obeyed by the following patches.
The dev_set_drvdata(NULL) on remove is mostly cargo-cult nonsense. The
driver core sets it to null immediately after the remove function
returns, so to add another set needs a very strong reason.

It is only left here temporarily, the last patch deletes it.

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help