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 8C0E7C433F5 for ; Wed, 2 Feb 2022 01:14:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1657838D4; Wed, 2 Feb 2022 02:10:53 +0100 (CET) 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="MZtQjPgT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 08E0782FA5; Wed, 2 Feb 2022 02:10:53 +0100 (CET) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 49DB983900 for ; Wed, 2 Feb 2022 02:10:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x62d.google.com with SMTP id l13so8192740plg.9 for ; Tue, 01 Feb 2022 17:10:37 -0800 (PST) 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=eYHYzsO6Ya0KXfUNViqMWI46hl0I0il0h5rYfPH5f+o=; b=MZtQjPgTd3L0g3WEFZxOtJZWDeOuIAOmI598v64TGrOxyUouMkDAFTns6t98kW+ejn lmBnV4Wo4H5di3idx42ce3JhnVLcJgrYMHDiRtMtq3sX5uIWpybsP9XLMsFx545cS8zI SBMJm+3RVWfZeRqB/5Jz5LhJ6Oq/1sW+hPFTA1hlTV5sCiuKUgn/iH3H1uUf/u3gBqnc pag2KHO8ecIbix4lJHscNzhqBYPIB5xHDM/RrTvZ5R5G8GJpFP/9/k3+dxA1xRlLQ7YX 4lphMIMqeEPIRl2eY+3v5P57bmqKmBbAryLBMQJF9CHmUQitvUchYSsyipsGsBuLcF8A wwhA== 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=eYHYzsO6Ya0KXfUNViqMWI46hl0I0il0h5rYfPH5f+o=; b=5gsRBzvS7vizOC/qRGsDZaZwFTURa7G8yKV+RJBISdhqVfFWrkhM02BUGy3vMzY/A7 60cTPwLGulyz9a+v+NDJEPX/zVa3FYgv3it3zx4DueAY4yWFWBRLTxRI+WzXbkaGvBgn XU1X7CqZOzDEC0cmhz4YRKZaHcDV2eRFOza6Loqzz+qm1sYTXNU5OGQOzDbF/bCG1DEX 5uR5YUHOPNvpJx1Xj5ZzpNshCsN4uzFwnY0HQMltNzNSu0bgdzdgRUpID+GBtvyeu1/A H5+jczRGDL2Rcwqe38SkqJGW5BV8UjlVgk5xtEUv195LGXJiFuXi4gf62lQhndeqDjuf juSw== X-Gm-Message-State: AOAM530PW4HTlp2FDcNfdaRMKPDyvMTMML/yC3ZNS/hnaA7nUKt+JYxd q2qD41Bs171/DUwMgyVwN6imTw== X-Google-Smtp-Source: ABdhPJzT6iALH0QDKsiAAlI7ssgpo5o99yNyK5gjll+mVEOz3Db2jVVDELL/xuu5vEQAu3AJXaAylw== X-Received: by 2002:a17:90b:1d06:: with SMTP id on6mr5508846pjb.6.1643764235099; Tue, 01 Feb 2022 17:10:35 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:314e:b83b:fa90:7f2e]) by smtp.gmail.com with ESMTPSA id f5sm10761429pfc.0.2022.02.01.17.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 17:10:34 -0800 (PST) From: AKASHI Takahiro To: lukma@denx.de, peng.fan@nxp.com, jh80.chung@samsung.com, bmeng.cn@gmail.com, peng.ma@nxp.com, sr@denx.de, xypron.glpk@gmx.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: masami.hiramatsu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH 19/19] efi_driver: align with efi_disk-dm integration Date: Wed, 2 Feb 2022 10:08:53 +0900 Message-Id: <20220202010853.40405-20-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220202010853.40405-1-takahiro.akashi@linaro.org> References: <20220202010853.40405-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.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.5 at phobos.denx.de X-Virus-Status: Clean With DM-efi_disk integration, we don't need to explicitly call efi_disk_create_partitions(). The only thing to do is to associate an efi_disk object to the corresponding udevice as we skip most of processing in efi_disk_probe() by the previous commit ("efi_loader: disk: not create BLK device for BLK(IF_TYPE_EFI) devices"). Signed-off-by: AKASHI Takahiro Reviewed-by: Simon Glass --- lib/efi_driver/efi_block_device.c | 34 +++++++++---------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 04cb3ef0d4e5..5baa6f87a375 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -35,6 +35,7 @@ #include #include #include +#include /* * EFI attributes of the udevice handled by this driver. @@ -106,25 +107,6 @@ static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, return blkcnt; } -/** - * Create partions for the block device. - * - * @handle: EFI handle of the block device - * @dev: udevice of the block device - * Return: number of partitions created - */ -static int efi_bl_bind_partitions(efi_handle_t handle, struct udevice *dev) -{ - struct blk_desc *desc; - const char *if_typename; - - desc = dev_get_uclass_plat(dev); - if_typename = blk_get_if_type_name(desc->if_type); - - return efi_disk_create_partitions(handle, desc, if_typename, - desc->devnum, dev->name); -} - /** * Create a block device for a handle * @@ -139,7 +121,6 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) char *name; struct efi_object *obj = efi_search_obj(handle); struct efi_block_io *io = interface; - int disks; struct efi_blk_plat *plat; EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io); @@ -173,15 +154,20 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) plat->handle = handle; plat->io = interface; + /* + * FIXME: necessary because we won't do almost nothing in + * efi_disk_create() when called from device_probe(). + */ + ret = dev_tag_set_ptr(bdev, DM_TAG_EFI, handle); + if (ret) + /* FIXME: cleanup for bdev */ + return ret; + ret = device_probe(bdev); if (ret) return ret; EFI_PRINT("%s: block device '%s' created\n", __func__, bdev->name); - /* Create handles for the partions of the block device */ - disks = efi_bl_bind_partitions(handle, bdev); - EFI_PRINT("Found %d partitions\n", disks); - return 0; } -- 2.33.0