This file implements I2C Host Protocol which provides callers with the ability to \r
do I/O transactions to all of the devices on the I2C bus.\r
\r
- Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>\r
+ Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
I2cHostContext->I2cEvent,\r
&I2cHostContext->Status\r
);\r
+\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG((DEBUG_ERROR, "I2cHostI2cBusConfigurationAvailable: Error starting I2C operation, %r\n", Status));\r
+ }\r
}\r
\r
/**\r
completion status\r
\r
@retval EFI_SUCCESS The operation completed successfully.\r
- @retval EFI_ABORTED The request did not complete because the driver\r
- was shutdown.\r
@retval EFI_BAD_BUFFER_SIZE The WriteBytes or ReadBytes buffer size is too large.\r
@retval EFI_DEVICE_ERROR There was an I2C error (NACK) during the operation.\r
This could indicate the slave device is not present.\r
//\r
RequestPacketSize = sizeof (UINTN) + RequestPacket->OperationCount * sizeof (EFI_I2C_OPERATION);\r
I2cRequest->RequestPacket = AllocateZeroPool (RequestPacketSize);\r
+ ASSERT (I2cRequest->RequestPacket != NULL);\r
CopyMem (I2cRequest->RequestPacket, RequestPacket, RequestPacketSize);\r
\r
//\r
&DeviceHandleBuffer\r
);\r
\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- //\r
- // Disconnect the driver specified by ImageHandle from all\r
- // the devices in the handle database.\r
- //\r
- for (Index = 0; Index < DeviceHandleCount; Index++) {\r
- Status = gBS->DisconnectController (\r
- DeviceHandleBuffer[Index],\r
- ImageHandle,\r
- NULL\r
- );\r
- if (EFI_ERROR (Status)) {\r
- goto Done;\r
+ if (!EFI_ERROR (Status)) {\r
+ //\r
+ // Disconnect the driver specified by ImageHandle from all\r
+ // the devices in the handle database.\r
+ //\r
+ for (Index = 0; Index < DeviceHandleCount; Index++) {\r
+ Status = gBS->DisconnectController (\r
+ DeviceHandleBuffer[Index],\r
+ ImageHandle,\r
+ NULL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto Done;\r
+ }\r
}\r
}\r
\r