Re: [PATCH] Drivers: hv: vmbus: Fix initialization of device object in vmbus_device_register()

From: Andrea Parri
Date: Fri Mar 11 2022 - 10:20:13 EST


> > ---
> > drivers/hv/vmbus_drv.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> > index 12a2b37e87f30..65db5048b1763 100644
> > --- a/drivers/hv/vmbus_drv.c
> > +++ b/drivers/hv/vmbus_drv.c
> > @@ -2097,6 +2097,9 @@ int vmbus_device_register(struct hv_device
> > *child_device_obj)
> > child_device_obj->device.parent = &hv_acpi_dev->dev;
> > child_device_obj->device.release = vmbus_device_release;
> >
> > + child_device_obj->device.dma_parms = &child_device_obj->dma_parms;
> > + child_device_obj->device.dma_mask = &child_device_obj->dma_mask;
> > +
> > /*
> > * Register with the LDM. This will kick off the driver/device
> > * binding...which will eventually call vmbus_match() and vmbus_probe()
> > @@ -2122,8 +2125,6 @@ int vmbus_device_register(struct hv_device
> > *child_device_obj)
> > }
> > hv_debug_add_dev_dir(child_device_obj);
> >
> > - child_device_obj->device.dma_parms = &child_device_obj->dma_parms;
> > - child_device_obj->device.dma_mask = &child_device_obj->dma_mask;
> > dma_set_mask(&child_device_obj->device, DMA_BIT_MASK(64));
>
> Is there any reason to not move dma_set_mask() as well? That call is
> closely related to the previous two lines, so it is unexpected to have
> them separated.

The only reason was "minimize diff"; sounds like I'll move it in v2. ;-)

Thanks,
Andrea