summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
index 07fec7c315..c78305e780 100644
--- a/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
+++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/EfiKey.c
@@ -1022,7 +1022,6 @@ USBKeyboardRegisterKeyNotify (
)
{
USB_KB_DEV *UsbKeyboardDevice;
- EFI_STATUS Status;
KEYBOARD_CONSOLE_IN_EX_NOTIFY *NewNotify;
LIST_ENTRY *Link;
LIST_ENTRY *NotifyList;
@@ -1066,20 +1065,11 @@ USBKeyboardRegisterKeyNotify (
NewNotify->Signature = USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE;
NewNotify->KeyNotificationFn = KeyNotificationFunction;
+ NewNotify->NotifyHandle = (EFI_HANDLE) NewNotify;
CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));
InsertTailList (&UsbKeyboardDevice->NotifyList, &NewNotify->NotifyEntry);
- //
- // Use gSimpleTextInExNotifyGuid to get a valid EFI_HANDLE
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &NewNotify->NotifyHandle,
- &gSimpleTextInExNotifyGuid,
- NULL,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
+
*NotifyHandle = NewNotify->NotifyHandle;
return EFI_SUCCESS;
@@ -1105,7 +1095,6 @@ USBKeyboardUnregisterKeyNotify (
)
{
USB_KB_DEV *UsbKeyboardDevice;
- EFI_STATUS Status;
KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
LIST_ENTRY *Link;
LIST_ENTRY *NotifyList;
@@ -1117,21 +1106,6 @@ USBKeyboardUnregisterKeyNotify (
UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);
//
- // Check if NotificationHandle is returned from RegisterKeyNotify().
- //
- Status = gBS->OpenProtocol (
- NotificationHandle,
- &gSimpleTextInExNotifyGuid,
- NULL,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
// Traverse notify list of USB keyboard and remove the entry of NotificationHandle.
//
NotifyList = &UsbKeyboardDevice->NotifyList;
@@ -1149,13 +1123,7 @@ USBKeyboardUnregisterKeyNotify (
// Remove the notification function from NotifyList and free resources
//
RemoveEntryList (&CurrentNotify->NotifyEntry);
- Status = gBS->UninstallMultipleProtocolInterfaces (
- CurrentNotify->NotifyHandle,
- &gSimpleTextInExNotifyGuid,
- NULL,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
+
FreePool (CurrentNotify);
return EFI_SUCCESS;
}