Re: [PATCH 2/5] virtio_mmio: Bind virtio device to device-tree node

From: Arnd Bergmann
Date: Tue Jul 13 2021 - 08:27:10 EST


On Tue, Jul 13, 2021 at 12:51 PM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> Bind the virtio device with its device protocol's sub-node. This will
> help users of the virtio device to mention their dependencies on the
> device in the DT file itself. Like GPIO pin users can use the phandle of
> the device node, or the node may contain more subnodes to add i2c or spi
> eeproms and other users.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> ---
> drivers/virtio/virtio_mmio.c | 44 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)

Hi Viresh,

I don't see anything in this patch that is specific to virtio-mmio, as
opposed to
virtio-pci. It would be better to move this into the virtio core code so it can
be called independently of the transport that is used for virtio.

The PCI code has similar code that will set vdev->dev.parent->of_node
for a virtio-pci device, as long as that node is present.

Arnd