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 B8B24C0015E for ; Thu, 27 Jul 2023 03:02:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A8A886786; Thu, 27 Jul 2023 05:01:55 +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="PJjAcMUA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C25EA8679C; Thu, 27 Jul 2023 05:01:46 +0200 (CEST) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 8A218862F1 for ; Thu, 27 Jul 2023 05:01:43 +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@chromium.org Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-3464c774f23so1568865ab.1 for ; Wed, 26 Jul 2023 20:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690426902; x=1691031702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e8nGIrCv2y4LP2a8Wg83hyRJP0LWK9feuDZrV9INe3M=; b=PJjAcMUA5Zrr+YYADihzuT/GO9J8+CKLDQOgVtjwI9bk6j0pxkvkvccFmXoBqh+Dac 23Vq3tpzP7uQS2HXOYjKZ0O3zS4gPiKT/S/jiBPT+Phb6LxnHxSR/YED8wn/XXn3xgHR 8JF/LFu32yxu51VhDrA25jfZHgWog7zdnABxk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690426902; x=1691031702; h=content-transfer-encoding:mime-version: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=e8nGIrCv2y4LP2a8Wg83hyRJP0LWK9feuDZrV9INe3M=; b=EkPNThl6sDI6ueStQGILjb6SOkmGgKlHaBh4WL1xKdZbD7Su3YowdgTlCDnAwnPot/ PsJLhxNY2ziWasvDaAgi6Hm5Oz+7eX5hF29tLChLu6oOgQE2a+qgoyZfwqT4LOzBQF1d NWlYyK552kNQqV1iBDgKMgoOTj/8aF8+jzM2dR+fijH7rtGYi5GS8h91JbizHoN4uQN0 ZoHamaqKW2jpLZcKxTuFb7F31GkRX1lLsHa4zcX5s0WIxGXv4+hRFbFRnmf3UcmJ47I6 au0Y7B6Cw953LMfU+DBN15c2CgIziC31iOXr0+jLZCosyEV04iyiughgIrnb7uWH0Pk5 28dA== X-Gm-Message-State: ABy/qLbqbTEcWoEPcSSUzEnU31rHjonNBWq7QKCrughZzWtijvYcvCzY oQCPKoSHuC7ZnlRpDgI2/BVSdtAs715OeoLhVPE= X-Google-Smtp-Source: APBJJlHNLptIO96CpFR/HiU+BH5MA4qUMY8x+QEBL5xrQGqaD19fFHVVCSUK33huqm2bYdA0gjl6Rw== X-Received: by 2002:a92:c5c5:0:b0:348:cfad:1608 with SMTP id s5-20020a92c5c5000000b00348cfad1608mr3769016ilt.5.1690426902097; Wed, 26 Jul 2023 20:01:42 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id a14-20020a92d58e000000b00348d41ffd13sm207539iln.85.2023.07.26.20.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 20:01:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 1/5] bootflow: Export setup_fs() Date: Wed, 26 Jul 2023 21:01:21 -0600 Message-ID: <20230727030128.459760-2-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230727030128.459760-1-sjg@chromium.org> References: <20230727030128.459760-1-sjg@chromium.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.8 at phobos.denx.de X-Virus-Status: Clean This function is used in some bootmeth implementations. Export it. Signed-off-by: Simon Glass --- boot/bootmeth-uclass.c | 23 ++++++----------------- include/bootmeth.h | 13 +++++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c index eeded08dd428..175eb1de5e1e 100644 --- a/boot/bootmeth-uclass.c +++ b/boot/bootmeth-uclass.c @@ -240,18 +240,7 @@ int bootmeth_set_order(const char *order_str) return 0; } -/** - * setup_fs() - Set up read to read a file - * - * We must redo the setup before each filesystem operation. This function - * handles that, including setting the filesystem type if a block device is not - * being used - * - * @bflow: Information about file to try - * @desc: Block descriptor to read from (NULL if not a block device) - * Return: 0 if OK, -ve on error - */ -static int setup_fs(struct bootflow *bflow, struct blk_desc *desc) +int bootmeth_setup_fs(struct bootflow *bflow, struct blk_desc *desc) { int ret; @@ -288,7 +277,7 @@ int bootmeth_try_file(struct bootflow *bflow, struct blk_desc *desc, log_debug(" %s - err=%d\n", path, ret); /* Sadly FS closes the file after fs_size() so we must redo this */ - ret2 = setup_fs(bflow, desc); + ret2 = bootmeth_setup_fs(bflow, desc); if (ret2) return log_msg_ret("fs", ret2); @@ -337,14 +326,14 @@ int bootmeth_alloc_other(struct bootflow *bflow, const char *fname, if (bflow->blk) desc = dev_get_uclass_plat(bflow->blk); - ret = setup_fs(bflow, desc); + ret = bootmeth_setup_fs(bflow, desc); if (ret) return log_msg_ret("fs", ret); ret = fs_size(path, &size); log_debug(" %s - err=%d\n", path, ret); - ret = setup_fs(bflow, desc); + ret = bootmeth_setup_fs(bflow, desc); if (ret) return log_msg_ret("fs", ret); @@ -369,7 +358,7 @@ int bootmeth_common_read_file(struct udevice *dev, struct bootflow *bflow, if (bflow->blk) desc = dev_get_uclass_plat(bflow->blk); - ret = setup_fs(bflow, desc); + ret = bootmeth_setup_fs(bflow, desc); if (ret) return log_msg_ret("fs", ret); @@ -379,7 +368,7 @@ int bootmeth_common_read_file(struct udevice *dev, struct bootflow *bflow, if (size > *sizep) return log_msg_ret("spc", -ENOSPC); - ret = setup_fs(bflow, desc); + ret = bootmeth_setup_fs(bflow, desc); if (ret) return log_msg_ret("fs", ret); diff --git a/include/bootmeth.h b/include/bootmeth.h index c3df9702e871..7cb7da33deaa 100644 --- a/include/bootmeth.h +++ b/include/bootmeth.h @@ -262,6 +262,19 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global); */ int bootmeth_set_order(const char *order_str); +/** + * bootmeth_setup_fs() - Set up read to read a file + * + * We must redo the setup before each filesystem operation. This function + * handles that, including setting the filesystem type if a block device is not + * being used + * + * @bflow: Information about file to try + * @desc: Block descriptor to read from (NULL if not a block device) + * Return: 0 if OK, -ve on error + */ +int bootmeth_setup_fs(struct bootflow *bflow, struct blk_desc *desc); + /** * bootmeth_try_file() - See we can access a given file * -- 2.41.0.487.g6d72f3e995-goog