Re: [PATCH] virtio: make PCI devices take a virtio_pci module ref

Anthony Liguori
2008-12-05T15:43:41Z

Mark McLoughlin wrote:
> On Fri, 2008-12-05 at 14:17 +0100, Jiri Slaby wrote:
>
> +static void virtio_pci_release_dev(struct device *dev)
> +{
> +}
> +
> /* A PCI device has it's own struct device and so does a virtio device so
> * we create a place for the virtio devices to show up in sysfs. I think it
> * would make more sense for virtio to not insist on having it's own device. */
> static struct device virtio_pci_root = {
> .parent = NULL,
> .bus_id = "virtio-pci",
> + .release = virtio_pci_release_dev,
> };
>

Actually, we should be able to delete this virtio_pci_root entirely.
The device is a dummy one anyway.

Regards,

Anthony Liguori

> /* Convert a generic virtio device to our structure */
> @@ -328,6 +333,7 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
> return -ENOMEM;
>
> vp_dev->vdev.dev.parent = &virtio_pci_root;
> + vp_dev->vdev.dev.release = virtio_pci_release_dev;
> vp_dev->vdev.config = &virtio_pci_config_ops;
> vp_dev->pci_dev = pci_dev;
> INIT_LIST_HEAD(&vp_dev->virtqueues);
>