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 B2256C433EF for ; Sun, 24 Oct 2021 19:59:35 +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 282FD60EE3 for ; Sun, 24 Oct 2021 19:59:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 282FD60EE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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 75B84835DD; Sun, 24 Oct 2021 21:56:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jsywS4Wo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 76B0983458; Sun, 24 Oct 2021 21:54:44 +0200 (CEST) Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1234782DF6 for ; Sun, 24 Oct 2021 21:54:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-oo1-xc2d.google.com with SMTP id o26-20020a4abe9a000000b002b74bffdef0so2925607oop.12 for ; Sun, 24 Oct 2021 12:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MHgc/8rQzV1Y/7Wmg2eO/eBIqbaz24nOnVY6v/WreTQ=; b=jsywS4WoxtRDuhuK9bZ/y5Ie46Slo8+0NSErZbkeOZPHkBlaf6piU5/skWNtLBW6ui LavVg5SOEhlFiB+CAbYDPO3pmTJWi7iKOXiRnFFO7OEm+GOjazly5iJamMON/mG3ZoOI hxkrGphwrFhA79gsNC5x67Kz5Gpm8gX8w8jcA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MHgc/8rQzV1Y/7Wmg2eO/eBIqbaz24nOnVY6v/WreTQ=; b=PycCVcx7LPZ8x93omzdoJbvyrWbmfMZ/yHrTYUDUOZr3z3CADDtGEbp3N+JajmecWd ZXHakxRnWuhs3Tsna1VuSKsOOzWFYUMN8gwae54/iG3e2Pa8FNu45mU6ZVDDEG0IAR2I jRTtqEHot1vHeFS2bYN6p59sFGbOUAxse9tBlsSwMyorV1/CQhRlse3f9QtvZtjJvQID TdIjKishrsO5sqFph3zSFfnzqW2qgeUXe6u+eMYbO0ekM9nIFj3R5Fy5lqrVFSOWPHUz o492j0BduraidqMYd7+l2DaV4fYx1u7ifXWp/VOBcYetyM8bkdqql9SyZE2xHQ11Bhin TrTQ== X-Gm-Message-State: AOAM5313lBkGg41UldP0YAn+mKUiCEBxWTsxO+ArwDVnwNLEhCns9Sjh 3vqMbFBXrtYsNNLXFHQEBSZ3+4Nr6/h0qKGwN+JqUw== X-Google-Smtp-Source: ABdhPJyEjD84M8cHi6velCPGWqxtA+0dPzgw3qXyLNdaynozakYhC8Gs7tM23ZPfjYDd48i8weGGhK+qVb+Ti9+yzbU= X-Received: by 2002:a4a:d6c7:: with SMTP id j7mr9439873oot.36.1635105271463; Sun, 24 Oct 2021 12:54:31 -0700 (PDT) MIME-Version: 1.0 References: <20211023140647.7661-1-heinrich.schuchardt@canonical.com> In-Reply-To: <20211023140647.7661-1-heinrich.schuchardt@canonical.com> From: Simon Glass Date: Sun, 24 Oct 2021 13:54:18 -0600 Message-ID: Subject: Re: [PATCH 1/1] blk: simplify blk_get_devnum_by_typename() To: Heinrich Schuchardt Cc: Patrick Delaunay , Ilias Apalodimas , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" 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 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? Regards, Simon