Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1245975
| From | Anatol Pomozov <anatol.pomozov@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] regmap: Add a config option for making regmap debugfs writable |
| Date | 2015-10-13 19:50 +0200 |
| Message-ID | <qjbS1-5fW-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Instead of modifiying source code directly one should use config files.
It is the standard way to set compile-time options.
Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
---
drivers/base/regmap/Kconfig | 6 ++++++
drivers/base/regmap/regmap-debugfs.c | 5 ++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig
index db9d00c3..579c8b5 100644
--- a/drivers/base/regmap/Kconfig
+++ b/drivers/base/regmap/Kconfig
@@ -9,6 +9,12 @@ config REGMAP
select IRQ_DOMAIN if REGMAP_IRQ
bool
+config REGMAP_ALLOW_WRITE_DEBUGFS
+ bool "Make regmap debugfs writable"
+ default n
+ select REGMAP
+ select DEBUG_FS
+
config REGMAP_AC97
tristate
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 3f0a7e2..3ea2e27 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -259,8 +259,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
count, ppos);
}
-#undef REGMAP_ALLOW_WRITE_DEBUGFS
-#ifdef REGMAP_ALLOW_WRITE_DEBUGFS
+#ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS
/*
* This can be dangerous especially when we have clients such as
* PMICs, therefore don't provide any real compile time configuration option
@@ -595,7 +594,7 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
if (map->max_register || regmap_readable(map, 0)) {
umode_t registers_mode;
-#if defined(REGMAP_ALLOW_WRITE_DEBUGFS)
+#ifdef CONFIG_REGMAP_ALLOW_WRITE_DEBUGFS
registers_mode = 0600;
#else
registers_mode = 0400;
--
2.6.0.rc2.230.g3dd15c0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] regmap: Add a config option for making regmap debugfs writable Anatol Pomozov <anatol.pomozov@gmail.com> - 2015-10-13 19:50 +0200
Re: [PATCH] regmap: Add a config option for making regmap debugfs writable Mark Brown <broonie@kernel.org> - 2015-10-13 20:00 +0200
Re: [PATCH] regmap: Add a config option for making regmap debugfs writable Anatol Pomozov <anatol.pomozov@gmail.com> - 2015-10-13 20:40 +0200
Re: [PATCH] regmap: Add a config option for making regmap debugfs writable Mark Brown <broonie@kernel.org> - 2015-10-13 22:10 +0200
csiph-web