lkml.org 
[lkml]   [2016]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 25/46] mtd: nandsim: Print backend name
Date
From: Richard Weinberger <richard@nod.at>

...useful to figure what backend is currently in use.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
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 47d8d41..838e5de 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
\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.118 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site