From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756613AbcIUJwS (ORCPT ); Wed, 21 Sep 2016 05:52:18 -0400 Received: from mail.sigma-star.at ([95.130.255.111]:45997 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755050AbcIUJwN (ORCPT ); Wed, 21 Sep 2016 05:52:13 -0400 From: Daniel Walter To: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, boris.brezillon@free-electrons.com, Richard Weinberger Subject: [PATCH v2 25/46] mtd: nandsim: Print backend name Date: Wed, 21 Sep 2016 11:52:09 +0200 Message-Id: X-Mailer: git-send-email 2.8.3 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Weinberger ...useful to figure what backend is currently in use. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 4 ++++ include/linux/mtd/nandsim.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 0e8574e..f8e5687 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -976,6 +976,7 @@ static int init_nandsim(struct mtd_info *mtd, struct nandsim_params *nsparam) ns->bops = nsparam->bops; + NS_INFO("Using backend: %s\n", ns->bops->name); if ((ret = ns->bops->init(ns, nsparam)) != 0) { NS_ERR("Unable to initialize simulator backend: %i\n", ret); return ret; @@ -1880,6 +1881,7 @@ static struct ns_backend_ops ns_ram_bops = { .read_page = ns_ram_read_page, .init = ns_ram_init, .destroy = ns_ram_destroy, + .name = "ram", }; static struct ns_backend_ops ns_cachefile_bops = { @@ -1888,6 +1890,7 @@ static struct ns_backend_ops ns_cachefile_bops = { .read_page = ns_cachefile_read_page, .init = ns_cachefile_init, .destroy = ns_cachefile_destroy, + .name = "cache_file", }; static struct ns_backend_ops ns_file_bops = { @@ -1896,6 +1899,7 @@ static struct ns_backend_ops ns_file_bops = { .read_page = ns_file_read_page, .init = ns_file_init, .destroy = ns_file_destroy, + .name = "file", }; /* diff --git a/include/linux/mtd/nandsim.h b/include/linux/mtd/nandsim.h index a0ca0fb..d71a02f 100644 --- a/include/linux/mtd/nandsim.h +++ b/include/linux/mtd/nandsim.h @@ -72,6 +72,7 @@ struct ns_backend_ops { void (*read_page)(struct nandsim *ns, int num); int (*init)(struct nandsim *ns, struct nandsim_params *nsparam); void (*destroy)(struct nandsim *ns); + char *name; }; struct mtd_info *ns_new_instance(struct nandsim_params *nsparam); -- 2.8.3