[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 05/18] OvmfPkg/XenBusDxe: Open PciIo protocol.



On Thu, Sep 04, 2014 at 05:51:00PM +0100, Anthony PERARD wrote:

Please explain why you need it, and with that added you can
tack on:

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>

> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> 
> ---
> Change in V2:
> - Coding style
> - Error handler
> ---
>  OvmfPkg/XenBusDxe/XenBusDxe.c | 18 ++++++++++++++++++
>  OvmfPkg/XenBusDxe/XenBusDxe.h |  1 +
>  2 files changed, 19 insertions(+)
> 
> diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c
> index db88cb4..15420c8 100644
> --- a/OvmfPkg/XenBusDxe/XenBusDxe.c
> +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c
> @@ -296,11 +296,25 @@ XenBusDxeDriverBindingStart (
>  {
>    EFI_STATUS Status;
>    XENBUS_DEVICE *Dev;
> +  EFI_PCI_IO_PROTOCOL *PciIo;
> +
> +  Status = gBS->OpenProtocol (
> +                     ControllerHandle,
> +                     &gEfiPciIoProtocolGuid,
> +                     (VOID **) &PciIo,
> +                     This->DriverBindingHandle,
> +                     ControllerHandle,
> +                     EFI_OPEN_PROTOCOL_BY_DRIVER
> +                     );
> +  if (EFI_ERROR (Status)) {
> +    return Status;
> +  }
>  
>    Dev = AllocateZeroPool (sizeof (*Dev));
>    Dev->Signature = XENBUS_DEVICE_SIGNATURE;
>    Dev->This = This;
>    Dev->ControllerHandle = ControllerHandle;
> +  Dev->PciIo = PciIo;
>  
>    Status = XenHyperpageInit (Dev);
>    if (EFI_ERROR (Status)) {
> @@ -327,6 +341,8 @@ XenBusDxeDriverBindingStart (
>  
>  ErrorNoHyperpage:
>    FreePool (Dev);
> +  gBS->CloseProtocol (ControllerHandle, &gEfiPciIoProtocolGuid,
> +                      This->DriverBindingHandle, ControllerHandle);
>    return Status;
>  }
>  
> @@ -369,5 +385,7 @@ XenBusDxeDriverBindingStop (
>  
>    gBS->CloseEvent (Dev->ExitBootEvent);
>  
> +  gBS->CloseProtocol (ControllerHandle, &gEfiPciIoProtocolGuid,
> +         This->DriverBindingHandle, ControllerHandle);
>    return EFI_SUCCESS;
>  }
> diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.h b/OvmfPkg/XenBusDxe/XenBusDxe.h
> index af0510a..c16ad95 100644
> --- a/OvmfPkg/XenBusDxe/XenBusDxe.h
> +++ b/OvmfPkg/XenBusDxe/XenBusDxe.h
> @@ -100,6 +100,7 @@ struct _XENBUS_DEVICE {
>    UINT32                        Signature;
>    EFI_DRIVER_BINDING_PROTOCOL   *This;
>    EFI_HANDLE                    ControllerHandle;
> +  EFI_PCI_IO_PROTOCOL           *PciIo;
>    EFI_EVENT                     ExitBootEvent;
>  
>    VOID                          *Hyperpage;
> -- 
> Anthony PERARD
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.