提交 1635e888 编写于 作者: A Axel Lin 提交者: Mark Brown

regmap: debugfs: Fix misuse of IS_ENABLED

IS_ENABLED should only be used for CONFIG_* symbols.

I have done a small test:
  #define REGMAP_ALLOW_WRITE_DEBUGFS
  IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.

  #define REGMAP_ALLOW_WRITE_DEBUGFS 0
  IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.

  #define REGMAP_ALLOW_WRITE_DEBUGFS 1
  IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 1.

  #define REGMAP_ALLOW_WRITE_DEBUGFS 2
  IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.

So fix the misuse of IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) and switch to
use #if defined(REGMAP_ALLOW_WRITE_DEBUGFS) instead.
Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 d3dc5430
...@@ -599,10 +599,11 @@ void regmap_debugfs_init(struct regmap *map, const char *name) ...@@ -599,10 +599,11 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
if (map->max_register || regmap_readable(map, 0)) { if (map->max_register || regmap_readable(map, 0)) {
umode_t registers_mode; umode_t registers_mode;
if (IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS)) #if defined(REGMAP_ALLOW_WRITE_DEBUGFS)
registers_mode = 0600; registers_mode = 0600;
else #else
registers_mode = 0400; registers_mode = 0400;
#endif
debugfs_create_file("registers", registers_mode, map->debugfs, debugfs_create_file("registers", registers_mode, map->debugfs,
map, &regmap_map_fops); map, &regmap_map_fops);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册