diff options
author | Bartosz Golaszewski <brgl@bgdev.pl> | 2017-12-22 12:42:08 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-12-27 05:33:24 -0500 |
commit | 078711d7f88d33b0adebb402a1bcb2aa89afe68b (patch) | |
tree | 540e6b4e8e9e8ce21b3dfea484dea3a07611c66c | |
parent | a5ba91c380b8bcca21e6166fc71c5e5ac9f0db68 (diff) |
regmap: debugfs: document why we don't create the debugfs entries
This is a follow-up to commit a5ba91c380b8 ("regmap: debugfs: emit a
debug message when locking is disabled"). I figured that a user may
see this message, grep the code, come to this place and he still won't
know why we actually disabled debugfs.
Add a comment explaining the reason.
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index ae962b756863..f3266334063e 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c | |||
@@ -529,6 +529,13 @@ void regmap_debugfs_init(struct regmap *map, const char *name) | |||
529 | struct regmap_range_node *range_node; | 529 | struct regmap_range_node *range_node; |
530 | const char *devname = "dummy"; | 530 | const char *devname = "dummy"; |
531 | 531 | ||
532 | /* | ||
533 | * Userspace can initiate reads from the hardware over debugfs. | ||
534 | * Normally internal regmap structures and buffers are protected with | ||
535 | * a mutex or a spinlock, but if the regmap owner decided to disable | ||
536 | * all locking mechanisms, this is no longer the case. For safety: | ||
537 | * don't create the debugfs entries if locking is disabled. | ||
538 | */ | ||
532 | if (map->debugfs_disable) { | 539 | if (map->debugfs_disable) { |
533 | dev_dbg(map->dev, "regmap locking disabled - not creating debugfs entries\n"); | 540 | dev_dbg(map->dev, "regmap locking disabled - not creating debugfs entries\n"); |
534 | return; | 541 | return; |