From patchwork Sun Nov 20 00:21:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 627131 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp965051pvb; Sat, 19 Nov 2022 16:23:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4iEjgWkuhI8d0eR6ya9GLjc9FR2nX3sCdtCChZk7lun7KWKUayfhFlQ+Z3QVD0VbLTnrjq X-Received: by 2002:a05:6102:41a5:b0:3aa:3de6:fb96 with SMTP id cd37-20020a05610241a500b003aa3de6fb96mr7091774vsb.32.1668903788383; Sat, 19 Nov 2022 16:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668903788; cv=none; d=google.com; s=arc-20160816; b=sRdARUzn2o5FuTgKP1mfUC2Hs08YRdaPSb9I64a6kK1J8IifnTdonmqT6GMaorVPqG 47zqU8vlQQa4Ypc94g2RWJ5rNI8ySgAFlCITp8I0aOPMtzITAImqM65uz5X7NFKB5v7V iaXiFms9b+TO1VZqj6r0hxficQdynMVs0ZFt3igYXLo0SsjPTlvC0dd8OgtPts98WwKb 52PGD2l5IhF08ggbEdHctW0d5AFqoH4HNMSfWarJEhBghEVaIL5CCBeWWwzR2hA96Z6j xhwfDVJsArLbFAPyAw2NgmDzhI3Nis8BlWw5A8nmH3UlLWPLbkNLMCtypW4H5CggJQxx ao0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=8ZUSUMWGXhjZ4QcuBL/EqMRefVmnA5oofCWdDmsDgS4=; b=BfLciXW3ik/jz9fOaze4Yw28pD3zZl+inAldR3z0ckYwaY14UFoUpPviya53fqVRH2 JErIYgNo5B6LtAEJBcUUfeH3m/4Vzw7qTn/COER8JdKUUl1+VsoTqu60aIWZnJ6gU56W 6XtdmoIsPE/GLgfZly8DXxYFUppwBb+YOOj91agUU8mldfWeQNq5r2Ir3dsR0tvHUKJM BkbHpfJANh74xySHLutZa42UT3XaME3IrvjB/deYRMJs+TZxfKKLUMJG1SfBkrZG244O H9SuiMdZjTWCffiu5MKE+9X6MW2s78dJRe41zLGdnW8tc1EoKvlisszzeTz6SFPM/A// ofAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rJVjLFct; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id p15-20020a1fa60f000000b003a37d629d49si1249280vke.296.2022.11.19.16.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Nov 2022 16:23:08 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rJVjLFct; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C8679851EA; Sun, 20 Nov 2022 01:22:27 +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="rJVjLFct"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 89441851EA; Sun, 20 Nov 2022 01:22:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (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 D044484956 for ; Sun, 20 Nov 2022 01:22:05 +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=masahisa.kojima@linaro.org Received: by mail-pf1-x42c.google.com with SMTP id q9so8256164pfg.5 for ; Sat, 19 Nov 2022 16:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=8ZUSUMWGXhjZ4QcuBL/EqMRefVmnA5oofCWdDmsDgS4=; b=rJVjLFctwaJjkBt7Bu87mQ/tK4sEwrPAGoKaSSblcNhIOFoQrttnOc7/ylVtfl00Uz yuCRW3hBWcIRyoANS0XlXNTXC9kB9TOadZitbsfQ7Aw8c0emb2z7gpayDRG2tjbgGohy zVef1eP3CU/TV2Nui2WiWUtL9CyW4GFjxFQyJlmVHcFOqrw3WxyDU3sLpkMSdx9E40U9 7jqouGQ5/uAo0Yx2BQKb3fJm0mhe3JVFegApHNNpbWXiOiUNkQjcuDhjAdr3kvhJcR7n R05g3wtSSjRYzQdi45Ch/ek2tGi4RY2lfk6D1Sk1l721R3v/3r3Gz0LsUXXNL232ckGS SfTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8ZUSUMWGXhjZ4QcuBL/EqMRefVmnA5oofCWdDmsDgS4=; b=7s3STX90D3Zh5UBoKmkArOEvWJw3tcDl+DRHjX60Xc6ddMFmeGeJasn0qT41zv9xPM UgSkIutjiDC27lkDskjVxq7e73B+yzBYfNWD8N02g2PhP2wcR7N0YWEsVfTgZeP7MRXn 5ZkbG7J/Oo8ymtkn5t5v5rDWqPJY/59aO7CVmP0e9VuMcm/zLXUPzHKCaRikz3Osu7F3 SfMm0zq04gH0ykjN5owMqtwsLoZaFOXfppHr9yJ+orlA4E6Dv9tCXq0HRVFRmT532Mi4 Pj4/9mifmQjdpx5ViWWNR9Y4Zv+i9uPFqaBc/lPw9Huq3ltDTwOipUOOwX0Mj++pRMrT dQxg== X-Gm-Message-State: ANoB5pmZ7v523UxMOYq5u6N1HENjMjeRahQQLpV7Fn4ydZSFEBaIb7c1 nu7iF5tpI5tzg/xGh/XSt3yBPlz1WChz7g== X-Received: by 2002:aa7:9d0b:0:b0:572:6da6:de4f with SMTP id k11-20020aa79d0b000000b005726da6de4fmr13965738pfp.26.1668903723825; Sat, 19 Nov 2022 16:22:03 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id d12-20020a170902654c00b00168dadc7354sm1859431pln.78.2022.11.19.16.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Nov 2022 16:22:03 -0800 (PST) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Etienne Carriere , Masahisa Kojima Subject: [PATCH v10 5/7] eficonfig: use protocol interface for file selection Date: Sun, 20 Nov 2022 09:21:17 +0900 Message-Id: <20221120002119.23683-6-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221120002119.23683-1-masahisa.kojima@linaro.org> References: <20221120002119.23683-1-masahisa.kojima@linaro.org> 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.6 at phobos.denx.de X-Virus-Status: Clean EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is not always provided by U-Boot. Use protocol interface functions instead of U-Boot internal functions. Signed-off-by: Masahisa Kojima --- Newly created in v10 cmd/eficonfig.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index 58a6856666..6779b1792e 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -696,14 +696,14 @@ eficonfig_create_file_entry(struct efimenu *efi_menu, u32 count, u32 i, entry_num = 0; struct eficonfig_file_entry_data *info; - efi_file_setpos_int(f, 0); + EFI_CALL(f->setpos(f, 0)); /* Read directory and construct menu structure */ for (i = 0; i < count; i++) { if (entry_num >= EFICONFIG_ENTRY_NUM_MAX - 1) break; len = sizeof(struct efi_file_info) + EFICONFIG_FILE_PATH_BUF_SIZE; - ret = efi_file_read_int(f, &len, buf); + ret = EFI_CALL(f->read(f, &len, buf)); if (ret != EFI_SUCCESS || len == 0) break; @@ -782,7 +782,8 @@ static efi_status_t eficonfig_show_file_selection(struct eficonfig_select_file_i } INIT_LIST_HEAD(&efi_menu->list); - ret = efi_file_open_int(root, &f, file_info->current_path, EFI_FILE_MODE_READ, 0); + ret = EFI_CALL(root->open(root, &f, file_info->current_path, + EFI_FILE_MODE_READ, 0)); if (ret != EFI_SUCCESS) { eficonfig_print_msg("Reading volume failed!"); free(efi_menu); @@ -793,7 +794,7 @@ static efi_status_t eficonfig_show_file_selection(struct eficonfig_select_file_i /* Count the number of directory entries */ for (;;) { len = sizeof(struct efi_file_info) + EFICONFIG_FILE_PATH_BUF_SIZE; - ret = efi_file_read_int(f, &len, buf); + ret = EFI_CALL(f->read(f, &len, buf)); if (ret != EFI_SUCCESS || len == 0) break; @@ -818,7 +819,7 @@ static efi_status_t eficonfig_show_file_selection(struct eficonfig_select_file_i ret = eficonfig_process_common(efi_menu, " ** Select File **"); err: - efi_file_close_int(f); + EFI_CALL(f->close(f)); eficonfig_destroy(efi_menu); if (tmp_infos) { @@ -1024,7 +1025,7 @@ efi_status_t eficonfig_process_select_file(void *data) if (!tmp->current_volume) return EFI_INVALID_PARAMETER; - ret = efi_open_volume_int(tmp->current_volume, &root); + ret = EFI_CALL(tmp->current_volume->open_volume(tmp->current_volume, &root)); if (ret != EFI_SUCCESS) goto out;