From patchwork Fri Oct 4 03:05:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1171536 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="CWReMOsx"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46kvpJ0KqHz9sPd for ; Fri, 4 Oct 2019 13:03:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A7675C21F19; Fri, 4 Oct 2019 03:02:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 15536C21F19; Fri, 4 Oct 2019 03:02:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A8A7DC21E4E; Fri, 4 Oct 2019 03:02:08 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id 91197C21F5E for ; Fri, 4 Oct 2019 03:02:07 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id q21so2953736pfn.11 for ; Thu, 03 Oct 2019 20:02:07 -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=3Uy9rf+p3szWadzg7e4h73sYQr0EFsvRe6RDHfV/LRM=; b=CWReMOsxFRPUD7Gx/QkM+iZNsMLhMPiYRLpyAYI4vbdSPAbrwLc4SieypIIepQPuzv ilV57lMNHqodgV7+QITcT2oYVVVhZK66d0inJdFdpcItzSn8QzUH7ttJdwQPb00+ZTLN p+IS+aOD+18LIwJz4QFg8Q4i8rFcqJ43Vefl9TUX8FxbyswcwnmALJOyrqY+CQ99sRYR IYM7gYF0nhngwdeZBF526Ywpar9gwqytfajlS0sxb1oe444dOEo6Xe8S2sNad/umWbTc KQtpZDUun0hOpM+f8BnMQ15OtQNw7KgLL/0TSPdT7lpcvJDdpI+ymrG6DjLnViChOF/1 YMHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3Uy9rf+p3szWadzg7e4h73sYQr0EFsvRe6RDHfV/LRM=; b=ixq1NB/1HvKGLJN1OD8nl8qPo7NYlYz5VALFO2dBy66/U+aqvMEIKxGbvC7c1Owee7 4Mf/H+Cc/kDuc0tZJ/rTwFzWDocuo8Zo5r1S3Czjsjfr1nakr2cuh1mpfrLhMuJhRoQf 0xkenf0aMh9EkI4x6cmq3raYPDw1SQjT0JdocZk8KyskNRFU3l/hGtHC5mqoUFD/LuDJ 9/yBiPuhnM53b6Ac0XoJnE+Mmy4VUYCcQqi9QDhW3nm6aeOJfXDS0dS1JK7KeYOT0RFm Fte7LGE1QBk9CSy1zH6iJ73VtTUNTlj0Iek5rdLrNSI4Txq11by2TMRSc2k7hy1ty9yb zoZg== X-Gm-Message-State: APjAAAVTWJnGfiJYFNnn/bZJ4WWH5TA+j6DS0ERgiRg6l2Sz7UgWJOGQ OQcZHWizmVtv9LDJ9Q/fXu9FUQ== X-Google-Smtp-Source: APXvYqxI9FVIgHtJubC1SaOw674hJE4LDK9BVeqNYhWe25ZhaEzMtSIw/3T4n4uziXbOcJGS5YRa4g== X-Received: by 2002:aa7:8d8a:: with SMTP id i10mr14536333pfr.45.1570158125941; Thu, 03 Oct 2019 20:02:05 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id m136sm5493976pga.94.2019.10.03.20.02.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Oct 2019 20:02:05 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, xypron.glpk@gmx.de, agraf@csgraf.de Date: Fri, 4 Oct 2019 12:05:21 +0900 Message-Id: <20191004030523.21579-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191004030523.21579-1-takahiro.akashi@linaro.org> References: <20191004030523.21579-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 2/4] fs: add fs_get_type() for current filesystem type X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" This function is a variant of fs_get_type_name() and returns a filesystem type with which the current device is associated. We don't want to export fs_type variable directly because we have to take care of it consistently within fs.c. Signed-off-by: AKASHI Takahiro Reviewed-by: Heinrich Schuchardt --- fs/fs.c | 13 +++++++++++++ include/fs.h | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/fs/fs.c b/fs/fs.c index 64ba25fea8bf..e5307dbeaa37 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -307,6 +307,19 @@ static struct fstype_info *fs_get_info(int fstype) return info; } +/** + * fs_get_type() - Get type of current filesystem + * + * Return: filesystem type + * + * Returns filesystem type representing the current filesystem, or + * FS_TYPE_ANY for any unrecognised filesystem. + */ +int fs_get_type(void) +{ + return fs_type; +} + /** * fs_get_type_name() - Get type of current filesystem * diff --git a/include/fs.h b/include/fs.h index 5a1244d57fd2..6dfdb5c5307a 100644 --- a/include/fs.h +++ b/include/fs.h @@ -44,6 +44,16 @@ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part); */ void fs_close(void); +/** + * fs_get_type() - Get type of current filesystem + * + * Return: filesystem type + * + * Returns filesystem type representing the current filesystem, or + * FS_TYPE_ANY for any unrecognised filesystem. + */ +int fs_get_type(void); + /** * fs_get_type_name() - Get type of current filesystem *