From 2719881a54aeec6b54fb45ca3d587af24d2692ee Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Tue, 17 Dec 2019 22:50:56 -0600 Subject: [PATCH] MdeModulePkg/Usb/Keyboard.c: remove Get/SetConfig calls SetConfig is already called during device enumeration, no need to do it again here. Signed-off-by: Matt DeVillier --- MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 37 ------------------------ 1 file changed, 37 deletions(-) diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c index 7505951c82..b1de8ffcd9 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -807,10 +807,8 @@ InitUSBKeyboard ( IN OUT USB_KB_DEV *UsbKeyboardDevice ) { - UINT16 ConfigValue; UINT8 Protocol; EFI_STATUS Status; - UINT32 TransferResult; REPORT_STATUS_CODE_WITH_DEVICE_PATH ( EFI_PROGRESS_CODE, @@ -822,41 +820,6 @@ InitUSBKeyboard ( InitQueue (&UsbKeyboardDevice->EfiKeyQueue, sizeof (EFI_KEY_DATA)); InitQueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, sizeof (EFI_KEY_DATA)); - // - // Use the config out of the descriptor - // Assumed the first config is the correct one and this is not always the case - // - Status = UsbGetConfiguration ( - UsbKeyboardDevice->UsbIo, - &ConfigValue, - &TransferResult - ); - if (EFI_ERROR (Status)) { - ConfigValue = 0x01; - // - // Uses default configuration to configure the USB Keyboard device. - // - Status = UsbSetConfiguration ( - UsbKeyboardDevice->UsbIo, - ConfigValue, - &TransferResult - ); - if (EFI_ERROR (Status)) { - // - // If configuration could not be set here, it means - // the keyboard interface has some errors and could - // not be initialized - // - REPORT_STATUS_CODE_WITH_DEVICE_PATH ( - EFI_ERROR_CODE | EFI_ERROR_MINOR, - (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_INTERFACE_ERROR), - UsbKeyboardDevice->DevicePath - ); - - return EFI_DEVICE_ERROR; - } - } - UsbGetProtocolRequest ( UsbKeyboardDevice->UsbIo, UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber,