From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.web08.29903.1611158343592470101 for ; Wed, 20 Jan 2021 07:59:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@9elements.com header.s=google header.b=U2zHOhU+; spf=pass (domain: 9elements.com, ip: 209.85.208.46, mailfrom: patrick.rudolph@9elements.com) Received: by mail-ed1-f46.google.com with SMTP id p22so26326880edu.11 for ; Wed, 20 Jan 2021 07:59:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rnEUXRX6k8UyF2NqY2ptQoZE+wa9UJZjdz5ydsLEE4s=; b=U2zHOhU+JJSaZFb0PvjHa+OE1LSlKwqNMCi7EkULMvi2JqaSXaupj6j1LKYX2+OQcC DZ8eWtSyMlbscej2Ui6D4qyFqZ8OGaBXNQ9iUyjcvqy8YGoYWF5I/vhjKZ9uQUVLlREq SkcTx08Q7hEDWaH4CN7t4ArbFSCCvF5vazLJKywtb6Vjz6kc+jeEvwMzbRpv/Txi1vyR 0UFRqV8sT5kqJyUS380q6eSiocuJyMtVpgFkWCSJELgBYujXuC6rFHJoGum3IiDWtPIt stg+CDa8nQ5vvYJs5ZVFUMhWDh6J4RrsZ2g4Ygt1uh0Cts6in0ncUfx5BDHOCaUI7Eyu SUaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rnEUXRX6k8UyF2NqY2ptQoZE+wa9UJZjdz5ydsLEE4s=; b=Cv3PG5p4CVm3+d00PTPGdXwYL55uLuY3vNyhXHBrKkxZ4Y9U+6myjUuTm7BzUlPDWB YyfATh9EGnoan/d6/goymwbGWcEMtrNTTfAtNoWr3734+q/2Wx9e7iSnl8d0MeCZH+gD nYvCEZf6xhOtwTIBdk9hsbLJpYT0XF7cJf78rDxOWttbC/j/ep98DnEyPXNKATxJWWNO I6HXYl5qcvUadutX2CQiMit1ZI5Pps5TG3gBlMoYCwxBojkLvlmbWCfARpPMnBoYiytG M8oS1AOYMTnjgjR8ErGK/l3HyYOeGtun4Hj9eeHe+6vj7QYjtiQPAaWScHB2OomT+tD7 0PHg== X-Gm-Message-State: AOAM532XW0Qb+IJ/F91p/fJ1rbJTuDWw2q19bYJB2SicNPjlFOJyajUL 1r/nLoFMe15FVg1mVdKc4G0+jLCX0Cxru1nx X-Google-Smtp-Source: ABdhPJwdiuFlDr653w58hcZvaRzpJAVuRBvm7MJZweqNx3J/Y+UTpuojmRybLCgcb5gZPLzI53o/9w== X-Received: by 2002:aa7:d94b:: with SMTP id l11mr7782503eds.1.1611158342243; Wed, 20 Jan 2021 07:59:02 -0800 (PST) Return-Path: Received: from rudolphp-notebook.9e.network (ip-95-222-8-167.hsi15.unitymediagroup.de. [95.222.8.167]) by smtp.gmail.com with ESMTPSA id h16sm1340360eds.21.2021.01.20.07.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 07:59:01 -0800 (PST) From: "Patrick Rudolph" To: devel@edk2.groups.io Cc: jian.j.wang@intel.com, hao.a.wu@intel.com, ray.ni@intel.com Subject: [PATCH 1/2] MdeModulePkg/Usb/Keyboard.c: remove Get/SetConfig calls Date: Wed, 20 Jan 2021 16:58:59 +0100 Message-Id: <20210120155900.3343123-1-patrick.rudolph@9elements.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Matt DeVillier 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/Us= b/UsbKbDxe/KeyBoard.c index 5faf82ea57..77e20b203f 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -801,10 +801,8 @@ InitUSBKeyboard ( IN OUT USB_KB_DEV *UsbKeyboardDevice=0D )=0D {=0D - UINT16 ConfigValue;=0D UINT8 Protocol;=0D EFI_STATUS Status;=0D - UINT32 TransferResult;=0D =0D REPORT_STATUS_CODE_WITH_DEVICE_PATH (=0D EFI_PROGRESS_CODE,=0D @@ -816,41 +814,6 @@ InitUSBKeyboard ( InitQueue (&UsbKeyboardDevice->EfiKeyQueue, sizeof (EFI_KEY_DATA));=0D InitQueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, sizeof (EFI_KEY_DAT= A));=0D =0D - //=0D - // Use the config out of the descriptor=0D - // Assumed the first config is the correct one and this is not always th= e case=0D - //=0D - Status =3D UsbGetConfiguration (=0D - UsbKeyboardDevice->UsbIo,=0D - &ConfigValue,=0D - &TransferResult=0D - );=0D - if (EFI_ERROR (Status)) {=0D - ConfigValue =3D 0x01;=0D - //=0D - // Uses default configuration to configure the USB Keyboard device.=0D - //=0D - Status =3D UsbSetConfiguration (=0D - UsbKeyboardDevice->UsbIo,=0D - ConfigValue,=0D - &TransferResult=0D - );=0D - if (EFI_ERROR (Status)) {=0D - //=0D - // If configuration could not be set here, it means=0D - // the keyboard interface has some errors and could=0D - // not be initialized=0D - //=0D - REPORT_STATUS_CODE_WITH_DEVICE_PATH (=0D - EFI_ERROR_CODE | EFI_ERROR_MINOR,=0D - (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_INTERFACE_ERROR),=0D - UsbKeyboardDevice->DevicePath=0D - );=0D -=0D - return EFI_DEVICE_ERROR;=0D - }=0D - }=0D -=0D UsbGetProtocolRequest (=0D UsbKeyboardDevice->UsbIo,=0D UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber,=0D --=20 2.26.2