From nobody Mon Nov 25 02:07:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81860+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81860+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1634103432; cv=none; d=zohomail.com; s=zohoarc; b=A6kNYJG4qZLL+iZoVtUL1z/pXtqTQbzetqSvPGeTc1GKJlXunQEtzdWERSAPQ+AoCyIznMxsAt9l8LrEAAnXc7U/BvZZCUuXinx3JPGlKKmuRpL2LrmEBKIVB4Yiv16Qezb2gjWooUMrN+0NgMCGJtMH4kxGYdbsVh7KNjPiNsg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634103432; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=kL13crb5zjAq8kTzg+oUteu3o45VYv4FgdWEAUDTW9I=; b=julCMX3c9x/beQaatt7cOIiH5IqakOdHLsYsJK5XZzVugeY+feWuyXF78DzwBhEmpeF1aHcnVnHBEr0RfpVMj/r80CGKeX9wb+FFFnY6Pu6Z5HlSDq5PNTruDeZlgIIczsjORmqoIAMnsiHtmJ6RFgToM750pCAP4g6cLEoqaj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81860+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1634103432338125.12444217481573; Tue, 12 Oct 2021 22:37:12 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iMwsYY1788612x3eFhRIF8vs; Tue, 12 Oct 2021 22:37:12 -0700 X-Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web10.4172.1634103431292409812 for ; Tue, 12 Oct 2021 22:37:11 -0700 X-Received: by mail-pj1-f52.google.com with SMTP id q10-20020a17090a1b0a00b001a076a59640so3048538pjq.0 for ; Tue, 12 Oct 2021 22:37:11 -0700 (PDT) X-Gm-Message-State: vGRsgmiEycc3MNH2EPtJ7HTbx1787277AA= X-Google-Smtp-Source: ABdhPJwcpYM7qb1EQKhX9YwxwaRCI579NJixNKQL2uX4JqHE2S2cwy1IJMPhCP0iXTTacefxrieMCw== X-Received: by 2002:a17:90a:7e82:: with SMTP id j2mr11129539pjl.165.1634103430790; Tue, 12 Oct 2021 22:37:10 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id q14sm4441139pjm.17.2021.10.12.22.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 22:37:10 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto Subject: [edk2-devel] [PATCH 3/4] Silicon/AtSha204a: Test the ControllerHandle is managed by this driver Date: Wed, 13 Oct 2021 14:37:08 +0900 Message-Id: <163410342814.323609.6646089068979201893.stgit@localhost> In-Reply-To: <163410340292.323609.10978291802739074305.stgit@localhost> References: <163410340292.323609.10978291802739074305.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634103432; bh=D4sGLJFy4XJC+bZUPEMavm7JkmKWjqDd20MrX/QOBpo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=okt02FIz67RePAIHtYh0YYtDRpF5lNCgUIBojeH/TQ1mWHOCwd5bkxeX575TMVVehRU UpJ/Pg2TBWOfZXSs2APfqyjqlE7KuImWnC8oIFNGTCG/qCAu5VSBoKtaJKWO4FIctBRFk mpBDrtDshHcpuAJ9aiybzAAGTkmgnaqhmj0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634103433629100001 From: Kazuhiko Sakamoto Test the @ControllerHandle is not NULL and is actually managed by this driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Kazuhiko Sakamoto Signed-off-by: Masami Hiramatsu --- Silicon/Atmel/AtSha204a/AtSha204aDriver.h | 1 + Silicon/Atmel/AtSha204a/ComponentName.c | 13 +++++++++++++ Silicon/Atmel/AtSha204a/DriverBinding.c | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Silicon/Atmel/AtSha204a/AtSha204aDriver.h b/Silicon/Atmel/AtSh= a204a/AtSha204aDriver.h index 615959baf4..11be15b25b 100644 --- a/Silicon/Atmel/AtSha204a/AtSha204aDriver.h +++ b/Silicon/Atmel/AtSha204a/AtSha204aDriver.h @@ -59,6 +59,7 @@ typedef struct { #define ATSHA204A_OPCODE_RANDOM 0x1b =20 extern EFI_COMPONENT_NAME2_PROTOCOL gAtSha204aDriverComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL gI2cHwrngDriverBinding; =20 EFI_STATUS AtSha204aInit ( diff --git a/Silicon/Atmel/AtSha204a/ComponentName.c b/Silicon/Atmel/AtSha2= 04a/ComponentName.c index eec7b9120b..cc1d970bcf 100644 --- a/Silicon/Atmel/AtSha204a/ComponentName.c +++ b/Silicon/Atmel/AtSha204a/ComponentName.c @@ -159,6 +159,19 @@ AtSha204aGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + if (!ControllerHandle) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EfiTestManagedDevice (ControllerHandle, + gI2cHwrngDriverBinding.DriverBindingHandl= e, + &gEfiI2cIoProtocolGuid); + if (EFI_ERROR (Status)) { + return Status; + } + if (ChildHandle !=3D NULL) { return EFI_UNSUPPORTED; } diff --git a/Silicon/Atmel/AtSha204a/DriverBinding.c b/Silicon/Atmel/AtSha2= 04a/DriverBinding.c index 38ffd80df9..e278ab0554 100644 --- a/Silicon/Atmel/AtSha204a/DriverBinding.c +++ b/Silicon/Atmel/AtSha204a/DriverBinding.c @@ -132,7 +132,6 @@ I2cHwrngDriverBindingStop ( } =20 =20 -STATIC EFI_DRIVER_BINDING_PROTOCOL gI2cHwrngDriverBinding =3D { I2cHwrngDriverBindingSupported, I2cHwrngDriverBindingStart, -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81860): https://edk2.groups.io/g/devel/message/81860 Mute This Topic: https://groups.io/mt/86281583/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-