From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52F3FC7619A for ; Mon, 27 Mar 2023 06:48:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50EE685FDE; Mon, 27 Mar 2023 08:48:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="oKXpQiYr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E152485CB1; Mon, 27 Mar 2023 08:48:17 +0200 (CEST) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 59BA085FDE for ; Mon, 27 Mar 2023 08:48:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 6B2103FBA0 for ; Mon, 27 Mar 2023 06:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1679899693; bh=OPcUS/ZbhDjG5u9A3B/ROqL0Jq31y7r2+DD270IaR+g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oKXpQiYrqFfmbtdpG2esQ7ce2noBaiYRduhog7mHvUH/ULpPxRyNVHbzz5lANeb/T ieq+gLbRyyBHquaK7KXINSXRowQVvmf3tT18P2zwja86DGw8iB16dBeMapiXchJkjm SGXjwf0Fzv5q8CTqOENZUuWPFyvfdnbIdsZ86+okjqMzeQ4rR/6Vn/KxZaubUDhJ03 nwx6X4hIbXEq9uoRPrFG1+iUTNddApRzYEV3GJrWVkoq5BwCowawupSI7z5ODXwsmx Vzrv4ZCr5i2kBowF23xqpbSeaUfg9spsqU28+orIOrf7otUgUuWQxkqrpGv+HSqBXt I4PFiyMZMQrqw== Received: by mail-wm1-f72.google.com with SMTP id bi5-20020a05600c3d8500b003edda1368d7so4243218wmb.8 for ; Sun, 26 Mar 2023 23:48:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679899693; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OPcUS/ZbhDjG5u9A3B/ROqL0Jq31y7r2+DD270IaR+g=; b=2KFiVPmycICaPIY9m3CSHh3KZJyCdngpjLcInH8Ijp5p47kz2E0t8FsA4hmHQt6OFO +FZ1YbC/3DmEizbFvFhQY386pp6tMRBR6OBJhRHNFy2KccO9JK+NDIoMdE+yVUlPTYOw mjnnvFcIEYDbDPpuQoOu1MBNZ5agqrxyas1Gnh21z/hzug7sEMr0tkBWROWZUyDT2mh5 mvIFYntjJHFw/JoDKWaE0VjbXaLwlnGc9/5GSBpewN4FHEjZOOhAuM0GSvNW3rObM7Oe +FvpIoehXWsF2koEpPGNWux4JRaChrsf93DX8z/HmP1RMlsRcFqg4XahIpxudvS3L6MI 5T/A== X-Gm-Message-State: AAQBX9e9PftjzX/1EdyhPb2+voLi9oBURw5F96DxuVf7UdIxUoJM9tfe 9ryFWksIhx+SBHP5LoM4m7F8gcgD+RtX/SDK06sO2QGAYjsin+ubgXqKD4i7qFKIJtqu9njifoa 77sYqmt4ZtgiPhejUCh1NEXKkmYJOG+Q= X-Received: by 2002:a5d:4a4d:0:b0:2d4:28a1:1b2d with SMTP id v13-20020a5d4a4d000000b002d428a11b2dmr8270077wrs.25.1679899693035; Sun, 26 Mar 2023 23:48:13 -0700 (PDT) X-Google-Smtp-Source: AKy350b3lO3G7V1Ewu9oV4437Zn4n9mb6ATc1IqYwBQk8FhYAugkAPO1cmctxf2NQj3i1T8pbFeAhQ== X-Received: by 2002:a5d:4a4d:0:b0:2d4:28a1:1b2d with SMTP id v13-20020a5d4a4d000000b002d428a11b2dmr8270061wrs.25.1679899692685; Sun, 26 Mar 2023 23:48:12 -0700 (PDT) Received: from [192.168.123.94] (ip-088-152-145-137.um26.pools.vodafone-ip.de. [88.152.145.137]) by smtp.gmail.com with ESMTPSA id o11-20020adfeacb000000b002cfefad9c1dsm24180938wrn.66.2023.03.26.23.48.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Mar 2023 23:48:12 -0700 (PDT) Message-ID: Date: Mon, 27 Mar 2023 08:48:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [RFC 1/7] dm: add get_dp_node() to struct uclass_driver Content-Language: en-US To: Simon Glass Cc: Ilias Apalodimas , Marek Vasut , Peng Fan , Jaehoon Chung , Patrick Delaunay , Patrice Chotard , Michal Suchanek , AKASHI Takahiro , u-boot@lists.denx.de References: <20230326172743.93974-1-heinrich.schuchardt@canonical.com> <20230326172743.93974-2-heinrich.schuchardt@canonical.com> From: Heinrich Schuchardt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 3/27/23 06:00, Simon Glass wrote: > Hi Heinrich, > > On Mon, 27 Mar 2023 at 06:27, Heinrich Schuchardt > wrote: >> >> Currently the device paths don't match the dm tree. >> We should create a device path node per dm tree node. >> >> Signed-off-by: Heinrich Schuchardt >> --- >> include/dm/uclass.h | 5 +++++ >> 1 file changed, 5 insertions(+) > > This affects very few uclasses but adds a field to all of them. I > think an event might be best for this. We can add an event spy in each > of the affected uclasses. EVENT_SPY does not allow to return information to the emitter of the event. event_notfify() does not allow to select a single recipient. In struct uclass_driver there are many other fields that are rarely used: int (*post_bind)(struct udevice *dev); int (*pre_unbind)(struct udevice *dev); int (*pre_probe)(struct udevice *dev); int (*post_probe)(struct udevice *dev); int (*pre_remove)(struct udevice *dev); int (*child_post_bind)(struct udevice *dev); int (*child_pre_probe)(struct udevice *dev); int (*child_post_probe)(struct udevice *dev); If we wanted to save memory in linker generated lists we would convert structures with pointers to variable size arrays e.g. struct ops * = { { POST_BIND, post_bind }, { CHILD_POST_BIND, child_post_bind}, { END, NULL }, } Best regards Heinrich > > >> >> diff --git a/include/dm/uclass.h b/include/dm/uclass.h >> index ee15c92063..e11637ce4d 100644 >> --- a/include/dm/uclass.h >> +++ b/include/dm/uclass.h >> @@ -11,6 +11,7 @@ >> >> #include >> #include >> +#include >> #include >> #include >> >> @@ -68,6 +69,7 @@ struct udevice; >> * @child_post_probe: Called after a child in this uclass is probed >> * @init: Called to set up the uclass >> * @destroy: Called to destroy the uclass >> + * @get_dp_node: Get EFI device path node >> * @priv_auto: If non-zero this is the size of the private data >> * to be allocated in the uclass's ->priv pointer. If zero, then the uclass >> * driver is responsible for allocating any data required. >> @@ -99,6 +101,9 @@ struct uclass_driver { >> int (*child_post_probe)(struct udevice *dev); >> int (*init)(struct uclass *class); >> int (*destroy)(struct uclass *class); >> +#if CONFIG_IS_ENABLED(EFI_LOADER) >> + struct efi_device_path *(*get_dp_node)(struct udevice *dev); >> +#endif >> int priv_auto; >> int per_device_auto; >> int per_device_plat_auto; >> -- >> 2.39.2 >>