X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=IntelFrameworkPkg%2FLibrary%2FPeiSmbusLibSmbusPpi%2FPeiSmbusLib.c;h=5a93371eb2b52bed60fc782b177423d87d84ed5e;hb=aa7fc1c11c3d57d82842dbede50d064639671a98;hp=db28021d58c228d053cf81baa02372799bcc000e;hpb=1257d0d837335b2442fb5a24e5144e2830f32e65;p=mirror_edk2.git
diff --git a/IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/PeiSmbusLib.c b/IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/PeiSmbusLib.c
index db28021d58..5a93371eb2 100644
--- a/IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/PeiSmbusLib.c
+++ b/IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/PeiSmbusLib.c
@@ -1,17 +1,8 @@
/** @file
-Implementation of SmBusLib class library for PEI phase.
+ Implementation of SmBusLib class library for PEI phase.
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-
-Module Name: PeiSmbusLib.c
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -21,21 +12,20 @@ Module Name: PeiSmbusLib.c
Gets Smbus PPIs.
This internal function retrieves Smbus PPI from PPI database.
-
- @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
+ If gEfiPeiSmbusPpiGuid can not be located, then ASSERT()
@return The pointer to Smbus PPI.
**/
EFI_PEI_SMBUS_PPI *
InternalGetSmbusPpi (
- EFI_PEI_SERVICES **PeiServices
- )
+ VOID
+ )
{
EFI_STATUS Status;
EFI_PEI_SMBUS_PPI *SmbusPpi;
- Status = (*PeiServices)->LocatePpi (PeiServices, &gEfiPeiSmbusPpiGuid, 0, NULL, (VOID **) &SmbusPpi);
+ Status = PeiServicesLocatePpi (&gEfiPeiSmbusPpiGuid, 0, NULL, (VOID **) &SmbusPpi);
ASSERT_EFI_ERROR (Status);
ASSERT (SmbusPpi != NULL);
@@ -43,7 +33,7 @@ InternalGetSmbusPpi (
}
/**
- Executes an SMBus operation to an SMBus controller.
+ Executes an SMBus operation to an SMBus controller.
This function provides a standard way to execute Smbus script
as defined in the SmBus Specification. The data can either be of
@@ -73,21 +63,21 @@ InternalSmBusExec (
)
{
EFI_PEI_SMBUS_PPI *SmbusPpi;
- EFI_PEI_SERVICES **PeiServices;
+ CONST EFI_PEI_SERVICES **PeiServices;
RETURN_STATUS ReturnStatus;
EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
PeiServices = GetPeiServicesTablePointer ();
- SmbusPpi = InternalGetSmbusPpi (PeiServices);
+ SmbusPpi = InternalGetSmbusPpi ();
SmbusDeviceAddress.SmbusDeviceAddress = SMBUS_LIB_SLAVE_ADDRESS (SmBusAddress);
ReturnStatus = SmbusPpi->Execute (
- PeiServices,
+ (EFI_PEI_SERVICES **) PeiServices,
SmbusPpi,
SmbusDeviceAddress,
SMBUS_LIB_COMMAND (SmBusAddress),
SmbusOperation,
- SMBUS_LIB_PEC (SmBusAddress),
+ SMBUS_LIB_PEC (SmBusAddress),
&Length,
Buffer
);