From nobody Mon Nov 25 01:45:07 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+81859+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+81859+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1634103424; cv=none; d=zohomail.com; s=zohoarc; b=fCrr7DDPqIuLQCq3EgnqsYcHdj8Nqp1qTnahDvbsDb1+zKhL0r7UtRQUayVbaZvgW3k625qEEe9wi4bluVJNYsV8wqlwK3gOAtnC8UWWJiS6iNSj75v/l76CkZFTAojzKvRrb5H2g+jaTyOipclRyxqXm+Jc4eKrk7/9j2TjahE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634103424; 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=0R16XqzP0L4ivJQVCqte8CbMNJ8YkREwfEKLyRpniPU=; b=ECCDzQc8PuEh7JSwfrSOtPREK0Wzbfs5OjMxI0HmjsC/P3xW9jFdhPRQzopueFEOq0QwTvUBk9DFgqsvEiL0e3wTAZHTKV4n9SpjlYDOsF6NBp9DzBPvZ3hibOisxPE26MUxnGIV/x7Oj09ng6QBDomJPr69GcBkpvoilty0+A0= 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+81859+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 1634103424086499.058109823222; Tue, 12 Oct 2021 22:37:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bqTzYY1788612xxegcgnDhOD; Tue, 12 Oct 2021 22:37:03 -0700 X-Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.web08.4184.1634103423172721437 for ; Tue, 12 Oct 2021 22:37:03 -0700 X-Received: by mail-pj1-f54.google.com with SMTP id d13-20020a17090ad3cd00b0019e746f7bd4so3581848pjw.0 for ; Tue, 12 Oct 2021 22:37:03 -0700 (PDT) X-Gm-Message-State: jLFh8TCteW92vnqjeJzB62JEx1787277AA= X-Google-Smtp-Source: ABdhPJw2XXU77teRxaFgQMi29jFQePv03Ov0CVUd/glGiYhwxyibD1zboC6blvBxIesacwii8d/cfA== X-Received: by 2002:a17:90b:4d84:: with SMTP id oj4mr11286401pjb.58.1634103422806; Tue, 12 Oct 2021 22:37:02 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id on17sm4803301pjb.47.2021.10.12.22.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 22:37:02 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto Subject: [edk2-devel] [PATCH 2/4] Silicon/SynQuacerI2cDxe: Test the ControllerHandle is managed by this driver Date: Wed, 13 Oct 2021 14:36:59 +0900 Message-Id: <163410341947.323609.17810050212681648650.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=1634103423; bh=u+OOGZc5K/sF+a5GVqAE5b7OPDMmqom4bUuf0aZTCyc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=eK7kgwJ4tlGsiLf8C6eUjEH6Hg2OR2dCynZEZ9Cos5qPvzIgXtmDSnp6NNtPsOWXwEx ScOukecP3ApFf1gLn8Dip3UQ/8W3o4FGCroMrUoweTb+PjJOni2GS/hz36crY/lfgXhsP 8JIUarVaEUyYcb01zw2gOll+9azJlFMiH9E= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634103425180100002 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 --- .../Drivers/SynQuacerI2cDxe/ComponentName.c | 13 +++++++++++++ .../Drivers/SynQuacerI2cDxe/DriverBinding.c | 2 +- .../Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/ComponentN= ame.c b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/ComponentName.c index 9e7f189c13..ed5f11f107 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/ComponentName.c +++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/ComponentName.c @@ -158,6 +158,19 @@ SynQuacerI2cGetControllerName ( OUT CHAR16 **ControllerName ) { + EFI_STATUS Status; + + if (!ControllerHandle) { + return EFI_INVALID_PARAMETER; + } + + Status =3D EfiTestManagedDevice (ControllerHandle, + gSynQuacerI2cDriverBinding.DriverBindingH= andle, + &gEdkiiNonDiscoverableDeviceProtocolGuid); + if (EFI_ERROR (Status)) { + return Status; + } + if (ChildHandle !=3D NULL) { return EFI_UNSUPPORTED; } diff --git a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/DriverBind= ing.c b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/DriverBinding.c index 4e265aacf1..912ae79d14 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/DriverBinding.c +++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/DriverBinding.c @@ -129,7 +129,7 @@ SynQuacerI2cDriverBindingStop ( } =20 =20 -STATIC EFI_DRIVER_BINDING_PROTOCOL gSynQuacerI2cDriverBinding =3D { +EFI_DRIVER_BINDING_PROTOCOL gSynQuacerI2cDriverBinding =3D { SynQuacerI2cDriverBindingSupported, SynQuacerI2cDriverBindingStart, SynQuacerI2cDriverBindingStop, diff --git a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI= 2cDxe.h b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cD= xe.h index f891e4bf2f..c6534e6972 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.h +++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.h @@ -25,6 +25,7 @@ #include =20 extern EFI_COMPONENT_NAME2_PROTOCOL gSynQuacerI2cDriverComponentName2; +extern EFI_DRIVER_BINDING_PROTOCOL gSynQuacerI2cDriverBinding; =20 #define SYNQUACER_I2C_SIGNATURE SIGNATURE_32 ('S', 'I', '2', 'C') #define SYNQUACER_I2C_FROM_THIS(a) CR ((a), SYNQUACER_I2C_MASTER, \ -=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 (#81859): https://edk2.groups.io/g/devel/message/81859 Mute This Topic: https://groups.io/mt/86281582/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-