aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regmap-debugfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-07 20:57:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-07 20:57:56 -0400
commitc831dd7352c0eedb270b9b6430590da5991bb65c (patch)
tree89d808ddea1eeb039eeff2e5815d2ba3b55a1cba /drivers/base/regmap/regmap-debugfs.c
parent2b425a3f112aa24666fc5f415c8bf0e9132bb6c0 (diff)
parentf5b313a2bcd4c436560c044c726d9ad84a3e4bb3 (diff)
Merge tag 'regmap-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap updates from Mark Brown: "The main update this time around is the addition of a standard DT binding for specifying the endianness of devices. This allows drivers to support any endianness of device register map without any code, useful for configurable IP blocks. There's also a few bug fixes that I didn't get round to sending, none of them terribly severe or new, and a reduction in size for struct regmap" * tag 'regmap-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Fix debugfs-file 'registers' mode regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error. regmap: debugfs: fix possbile NULL pointer dereference regmap: fix NULL pointer dereference in _regmap_write/read regmap: fix NULL pointer dereference in regmap_get_val_endian regmap: cache: Do not fail silently from regcache_sync calls regmap: change struct regmap's internal locks as union regmap: Split regmap_get_endian() in two functions regmap: of_regmap_get_endian() cleanup regmap: Fix DT endianess parsing logic regmap: Add explicit dependencies to catch "select" misuse regmap: Restore L: linux-kernel@vger.kernel.org entry regmap: Add the DT binding documentation for endianness regmap: add DT endianness binding support.
Diffstat (limited to 'drivers/base/regmap/regmap-debugfs.c')
-rw-r--r--drivers/base/regmap/regmap-debugfs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 0c94b661c16f..5799a0b9e6cc 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -473,6 +473,7 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
473{ 473{
474 struct rb_node *next; 474 struct rb_node *next;
475 struct regmap_range_node *range_node; 475 struct regmap_range_node *range_node;
476 const char *devname = "dummy";
476 477
477 /* If we don't have the debugfs root yet, postpone init */ 478 /* If we don't have the debugfs root yet, postpone init */
478 if (!regmap_debugfs_root) { 479 if (!regmap_debugfs_root) {
@@ -491,12 +492,15 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
491 INIT_LIST_HEAD(&map->debugfs_off_cache); 492 INIT_LIST_HEAD(&map->debugfs_off_cache);
492 mutex_init(&map->cache_lock); 493 mutex_init(&map->cache_lock);
493 494
495 if (map->dev)
496 devname = dev_name(map->dev);
497
494 if (name) { 498 if (name) {
495 map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", 499 map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s",
496 dev_name(map->dev), name); 500 devname, name);
497 name = map->debugfs_name; 501 name = map->debugfs_name;
498 } else { 502 } else {
499 name = dev_name(map->dev); 503 name = devname;
500 } 504 }
501 505
502 map->debugfs = debugfs_create_dir(name, regmap_debugfs_root); 506 map->debugfs = debugfs_create_dir(name, regmap_debugfs_root);