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 AE713C433EF for ; Fri, 1 Oct 2021 05:06:15 +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 36883611C1 for ; Fri, 1 Oct 2021 05:06:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 36883611C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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 23FBC83326; Fri, 1 Oct 2021 07:04:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="X8ZRRiOF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1987A83176; Fri, 1 Oct 2021 07:03:51 +0200 (CEST) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 EE57A83138 for ; Fri, 1 Oct 2021 07:03:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x52f.google.com with SMTP id e7so8379529pgk.2 for ; Thu, 30 Sep 2021 22:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bmMB/nA9xkBo6ahFeLmZvwsTNZp33CmIqHJrk8Hn7OE=; b=X8ZRRiOFWLKdauaaNTk2ybj/4Sb+69sI/xaoHXN46oG9osCII48O8zcVl7KBYj7E0G qS7Rd52zPvdA8kKG8+cdeKZnBjXY2S/Uff1vC4U00w0aZgV+/DJiytI6Wd9uaPz1ARaj dOIZimSW18We8hhabRe3AB+r7ga2yqcTQ9j4MCA+B2/S5N3C8civspz26XyqnzZi6T3O MFcAbcVHlFuN4T59SuG8gMtdmMbtYz0/Dxu+SBEhtrAjs7oMT7bYED3ml003p+TJHRkD DWhKohnblVFS9TfNrWKoDpABcpTU7ZuaFNBMSoOYLmWqkrZzWnNGHGZDmcpcgHKOjpCj inuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bmMB/nA9xkBo6ahFeLmZvwsTNZp33CmIqHJrk8Hn7OE=; b=MWkAx4SvMnLuBFvh/jO2z4RnJhP66HXsiUmDm1M2Vfrqwyin2g9R4vXGjZ80G2x/2P mHR72is7BWZPeqjkjtqLrxP+AG/sZ5cFXNDSKhGSuJGkRGv9dKGWWaFfAaqhRcvMuNt5 GDbnzFzDKc8ivFD4k5ZOweluPMTfTGrUPpGcqacIbVSorwdgxOCsUCMelfGlQLNHtzar IN82M4OEaJdUajiz1wq2Zz+4fyflEIKHQNzLjojixBlS1KCAUvlPNevJcZZEKHlhHANa Pbmsn/uaxRScphH+VW7xGGdu26nSYVJv9H+mvb1/NG1DIf5qIXMwpNQfYVcpoRoVFO8b Fx9w== X-Gm-Message-State: AOAM530PvfZNwkdtRvOlNnLG60i94TGk+8FmKbGXbU+DyL25FWtmKp62 mGZoxhbse0YhrDrN9+jiVyzZVw== X-Google-Smtp-Source: ABdhPJyh3aVh1mEphZwCFJOctQrA1t1uLdYNeXYQsTpkIhalCQqcRApvWfBJgcNxzxzny0KpvibKRw== X-Received: by 2002:a65:62d5:: with SMTP id m21mr8307754pgv.124.1633064624100; Thu, 30 Sep 2021 22:03:44 -0700 (PDT) Received: from localhost.localdomain (122-100-26-52m5.mineo.jp. [122.100.26.52]) by smtp.gmail.com with ESMTPSA id z8sm4615113pgc.53.2021.09.30.22.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:43 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC 09/22] dm: blk: add a device-probe hook for scanning disk partitions Date: Fri, 1 Oct 2021 14:02:01 +0900 Message-Id: <20211001050228.55183-18-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001050228.55183-1-takahiro.akashi@linaro.org> References: <20211001050228.55183-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Now that all the block device drivers have enable a probe hook, we will call blk_create_partitions() to enumerate all the partitions and create associated udevices when a block device is detected. Signed-off-by: AKASHI Takahiro --- drivers/block/blk-uclass.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index dd7f3c0fe31e..6ba11a8fa7f7 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -741,11 +741,25 @@ static int blk_post_probe(struct udevice *dev) struct blk_desc *desc = dev_get_uclass_plat(dev); part_init(desc); + + if (desc->part_type != PART_TYPE_UNKNOWN && + blk_create_partitions(dev)) + debug("*** creating partitions failed\n"); } return 0; } +static int blk_part_post_probe(struct udevice *dev) +{ + /* + * TODO: + * If we call blk_creat_partitions() here, it would allow for + * "partitions in a partition". + */ + return 0; +} + UCLASS_DRIVER(blk) = { .id = UCLASS_BLK, .name = "blk", @@ -821,6 +835,7 @@ U_BOOT_DRIVER(blk_partition) = { UCLASS_DRIVER(partition) = { .id = UCLASS_PARTITION, + .post_probe = blk_part_post_probe, .per_device_plat_auto = sizeof(struct disk_part), .name = "partition", }; -- 2.33.0