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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21FB5C433EF for ; Mon, 25 Oct 2021 07:54:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2CCAC60E08 for ; Mon, 25 Oct 2021 07:54:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2CCAC60E08 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9A2A780F1A; Mon, 25 Oct 2021 09:54:52 +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="t9WlkyS/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7314D80F16; Mon, 25 Oct 2021 09:54:50 +0200 (CEST) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (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 F142A80F16 for ; Mon, 25 Oct 2021 09:54:46 +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-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (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-1.canonical.com (Postfix) with ESMTPS id 9B5353FFEE for ; Mon, 25 Oct 2021 07:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1635148486; bh=duynUyiFQFW4x5wKTMu0itcUk0WfqrvPYSyO2cpDtXA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=t9WlkyS/SvKatCqiZcsQh6EXCA8UcCFAvHeFnn3iz6xilIVWJXb4AACVXdgyNa2e3 9SN9YEBZpdPeb2GMmPh3m4ucZVReibbxDmClihUlOnl+Lphxlpio91Xpn6FsjW82U6 W7OLm1PrNckHMD8k+LriEazWw3HagnFR6z37La/bX2I98uufqxkZOUCkBPWDWb9/ua fWFkC3aAnkTooaPosjaBnZXHBU3/omM3Pgro7BG90vlEPXtPwYXxtQX8RBkfcox/mY VjGlyhxMbqvljFUhL/u1eX6B9nbDrE2Oai67fz2StCqmxlbD45103zW3S2mvklyYXs Q7dtmYaSh46fw== Received: by mail-wm1-f71.google.com with SMTP id f20-20020a05600c155400b0030db7b29174so3627960wmg.2 for ; Mon, 25 Oct 2021 00:54:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=duynUyiFQFW4x5wKTMu0itcUk0WfqrvPYSyO2cpDtXA=; b=ymtgCDALu54THhrDp5Y0B8ds/Mf+ruGJg7zD+uDVA8Yu8SAENwxWPN+33PPfbmTbUd L2PQrGKVLI/X/wNpqtF38StT+UExqj3HF9pB/EZJ026YV0Nf+jV8Yv3/hw2x4HuUBWvf qkMNNe7+QuANqS6GkigZHtI1/DNx/is7Kx4l2vnrEebg0axhp4ZE3PL8VJz/3exe1+bf OrB2B3Uboco2g/Zxu3QRgCahFMRXGVLtHW3iQ+pxDjkbnR9QnUfW0LsWsHDpPbZtUp7b khPKt8tqWQl7kjRvhYvTtbbrlLAyNaYxAKJK9tvnq3A/l0NDSD6+zcKs7Ikr9I1S1ioH VUuA== X-Gm-Message-State: AOAM532AxfUmzNnsXOrd+3K+Is5oFHvr+DLdEJg3HCMajLhW6DZF+WBV BPztkynnS5gpAqMq4aE52TL/z9G4sKsRnRBttZFKqJtKHzPmq+C38bFVU7KyJD3dwgTBbMqYULY D57PwjXf92hEvA4IeSsa4gZ50vPFvT4U= X-Received: by 2002:a5d:448b:: with SMTP id j11mr2706963wrq.385.1635148485287; Mon, 25 Oct 2021 00:54:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5xUEf7ALSeU2DZJuHmTo5nBxuza6u6KwgaliJh9gYFu5ZO8YGCdxBT3MhxcUoaD4LTwj7rA== X-Received: by 2002:a5d:448b:: with SMTP id j11mr2706942wrq.385.1635148485103; Mon, 25 Oct 2021 00:54:45 -0700 (PDT) Received: from [192.168.123.55] (ip-88-152-144-157.hsi03.unitymediagroup.de. [88.152.144.157]) by smtp.gmail.com with ESMTPSA id 12sm6352698wmk.34.2021.10.25.00.54.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Oct 2021 00:54:44 -0700 (PDT) Message-ID: Date: Mon, 25 Oct 2021 09:54:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH 1/1] blk: simplify blk_get_devnum_by_typename() Content-Language: en-US To: Simon Glass Cc: Patrick Delaunay , Ilias Apalodimas , U-Boot Mailing List References: <20211023140647.7661-1-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.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 10/24/21 21:54, Simon Glass wrote: > Hi Heinrich, > > On Sat, 23 Oct 2021 at 08:06, Heinrich Schuchardt > wrote: >> >> The block descriptor contains the if_type. There is no need to first look >> up the uclass for the if_type and then to check the parent device's uclass >> to know if the device has the correct if_type. >> >> Signed-off-by: Heinrich Schuchardt >> --- >> drivers/block/blk-uclass.c | 35 +---------------------------------- >> 1 file changed, 1 insertion(+), 34 deletions(-) > > This seems to be heading in the wrong direction though. > > The IF_TYPE should really go away and be replaced with the UCLASS ID, I think. > > At present we have lots of calls to blk_create_device_f() which > specify the type. I think we should drop the IF_TYPE_.. arg to that > function and have it figured out from the uclass, in the interim. > > But why do we need IF_TYPE now? I admit that this patch is just an intermediate step. We can replace IF_TYPE by ULASS ID once SPL block devices are always using the driver model. Have we reached this point yet? I have not seen drivers/block/blk_legacy.c being deleted. Removing if_type_uclass_id[] is anyway on the right path. Best regards Heinrich