From patchwork Tue May 22 09:23:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 918112 X-Patchwork-Delegate: lukma@denx.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=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TxQoF7wJ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40qr3w3hS1z9s3T for ; Tue, 22 May 2018 19:30:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 332ADC21DED; Tue, 22 May 2018 09:29:36 +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=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 E952FC21D83; Tue, 22 May 2018 09:25:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6183EC21D8A; Tue, 22 May 2018 09:25:21 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id 70B7BC21E26 for ; Tue, 22 May 2018 09:25:09 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id n10-v6so31422987wmc.1 for ; Tue, 22 May 2018 02:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XBm0laV71aVqgHpkPyt2Y8Z7YHJwBDneTZaau6QRODc=; b=TxQoF7wJKSBIbR6R8JKLEAP3JTwuhfysk1s4naRQRiITUJSptEp/bBnGYeq0U3RBtc csHDmPkJmhD5WjIp2igCgejNjF8pdY/jSu16P59JnCHlWKRlUPDOF1yp1b4v3NucWvfc 2G0fuMvdSMaXt/xwJVQZm445jM3K4kgrtx5fDbOXmACZM6K84vmI64OVrywrsH8NsqAd sSKIwy5Sf3mOHilAfMaMb8d6phVMVdRC3IZNkYX8lZiUPbqo7HYelqlGHT5QTbVEaiHy QyH5THpd8OLG+PUzCpHiOVnJYtmD8AmKkPRuWxeHQBWmDjzgarDkL0XFywYbk6y8QBqC kkLQ== 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; bh=XBm0laV71aVqgHpkPyt2Y8Z7YHJwBDneTZaau6QRODc=; b=FjuGPN5QBqPNjeSUI9TU1sylSALnHI2Pm23dGRmDf8dCaz6BwK2anNuGhsQgRKf3l9 jZvTH9ZGv6ii7yRSM/O72yrYhJ8tdz+o9+CmlDQS/BbtaiX9MKAo2ztVIU6iL9KMPSMM WiF+bBSKUdNLq5XKxLR3N+zDKKK4UgZhoxjrebpTIv2e6sFyQquJVp7KP1u9PAndstHl bFqiG0FxqZ6Ps2rQnr/3PURzit4TxC6OMht1XlAwawYuG1U274ZbpU7/gNWkl8kttRgA EzAdUzAdvnu5IjH5dqybjIrIUVFXtXOTfcuAQDzVqsgGxkkpmdfg60fB1b+KeN4IduLr v5mg== X-Gm-Message-State: ALKqPwe0hTGu+c0CAwak8H7f46E0yd6IWdM4AJUkmouw3cj6VuZdawEQ dRWWwW4mv1dzSwi82JJwx1LGW4I1jqM= X-Google-Smtp-Source: AB8JxZqZG7K17hslnph9vPuQrWRAZ46AyB9DI2qnTplWrmfpGO3p9mwm7tKu8zYrz0PrdScsTc9PIg== X-Received: by 2002:a1c:b807:: with SMTP id i7-v6mr563178wmf.126.1526981108931; Tue, 22 May 2018 02:25:08 -0700 (PDT) Received: from localhost.localdomain (193.164.125.18.ip.redstone-isp.net. [193.164.125.18]) by smtp.gmail.com with ESMTPSA id s7-v6sm1404418wrp.4.2018.05.22.02.25.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 02:25:08 -0700 (PDT) From: Alex Kiernan To: u-boot@lists.denx.de, Joe Hershberger Date: Tue, 22 May 2018 09:23:46 +0000 Message-Id: <20180522092352.19794-13-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180522092352.19794-1-alex.kiernan@gmail.com> References: <20180522092352.19794-1-alex.kiernan@gmail.com> Cc: Jocelyn Bohr , Heinrich Schuchardt Subject: [U-Boot] [PATCH v6 12/18] fs: Add fs_get_type_name to return current filesystem name 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add fs_get_type_name so we can get the current filesystem type. Signed-off-by: Alex Kiernan Reviewed-by: Simon Glass Reviewed-by: Joe Hershberger --- Changes in v6: None Changes in v5: None Changes in v4: - add docbook comments Changes in v3: - new Changes in v2: None fs/fs.c | 13 +++++++++++++ include/fs.h | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/fs/fs.c b/fs/fs.c index 94cdc37deb..33808d549e 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -265,6 +265,19 @@ static struct fstype_info *fs_get_info(int fstype) return info; } +/** + * fs_get_type_name() - Get type of current filesystem + * + * Return: Pointer to filesystem name + * + * Returns a string describing the current filesystem, or the sentinel + * "unsupported" for any unrecognised filesystem. + */ +const char *fs_get_type_name(void) +{ + return fs_get_info(fs_type)->name; +} + int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype) { struct fstype_info *info; diff --git a/include/fs.h b/include/fs.h index d703ed5027..163da103b4 100644 --- a/include/fs.h +++ b/include/fs.h @@ -37,6 +37,16 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype); */ int fs_set_blk_dev_with_part(struct blk_desc *desc, int part); +/** + * fs_get_type_name() - Get type of current filesystem + * + * Return: Pointer to filesystem name + * + * Returns a string describing the current filesystem, or the sentinel + * "unsupported" for any unrecognised filesystem. + */ +const char *fs_get_type_name(void); + /* * Print the list of files on the partition previously set by fs_set_blk_dev(), * in directory "dirname".