Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
bee54e31
Commit
bee54e31
authored
Oct 28, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regmap/topic/core' into regmap-next
parents
5eff79fe
a52eaeb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
5 deletions
+52
-5
drivers/base/regmap/regmap-debugfs.c
drivers/base/regmap/regmap-debugfs.c
+52
-5
No files found.
drivers/base/regmap/regmap-debugfs.c
View file @
bee54e31
...
...
@@ -15,10 +15,19 @@
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <linux/device.h>
#include <linux/list.h>
#include "internal.h"
struct
regmap_debugfs_node
{
struct
regmap
*
map
;
const
char
*
name
;
struct
list_head
link
;
};
static
struct
dentry
*
regmap_debugfs_root
;
static
LIST_HEAD
(
regmap_debugfs_early_list
);
static
DEFINE_MUTEX
(
regmap_debugfs_early_lock
);
/* Calculate the length of a fixed format */
static
size_t
regmap_calc_reg_len
(
int
max_val
,
char
*
buf
,
size_t
buf_size
)
...
...
@@ -465,6 +474,20 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
struct
rb_node
*
next
;
struct
regmap_range_node
*
range_node
;
/* If we don't have the debugfs root yet, postpone init */
if
(
!
regmap_debugfs_root
)
{
struct
regmap_debugfs_node
*
node
;
node
=
kzalloc
(
sizeof
(
*
node
),
GFP_KERNEL
);
if
(
!
node
)
return
;
node
->
map
=
map
;
node
->
name
=
name
;
mutex_lock
(
&
regmap_debugfs_early_lock
);
list_add
(
&
node
->
link
,
&
regmap_debugfs_early_list
);
mutex_unlock
(
&
regmap_debugfs_early_lock
);
return
;
}
INIT_LIST_HEAD
(
&
map
->
debugfs_off_cache
);
mutex_init
(
&
map
->
cache_lock
);
...
...
@@ -519,18 +542,42 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
void
regmap_debugfs_exit
(
struct
regmap
*
map
)
{
debugfs_remove_recursive
(
map
->
debugfs
);
mutex_lock
(
&
map
->
cache_lock
);
regmap_debugfs_free_dump_cache
(
map
);
mutex_unlock
(
&
map
->
cache_lock
);
kfree
(
map
->
debugfs_name
);
if
(
map
->
debugfs
)
{
debugfs_remove_recursive
(
map
->
debugfs
);
mutex_lock
(
&
map
->
cache_lock
);
regmap_debugfs_free_dump_cache
(
map
);
mutex_unlock
(
&
map
->
cache_lock
);
kfree
(
map
->
debugfs_name
);
}
else
{
struct
regmap_debugfs_node
*
node
,
*
tmp
;
mutex_lock
(
&
regmap_debugfs_early_lock
);
list_for_each_entry_safe
(
node
,
tmp
,
&
regmap_debugfs_early_list
,
link
)
{
if
(
node
->
map
==
map
)
{
list_del
(
&
node
->
link
);
kfree
(
node
);
}
}
mutex_unlock
(
&
regmap_debugfs_early_lock
);
}
}
void
regmap_debugfs_initcall
(
void
)
{
struct
regmap_debugfs_node
*
node
,
*
tmp
;
regmap_debugfs_root
=
debugfs_create_dir
(
"regmap"
,
NULL
);
if
(
!
regmap_debugfs_root
)
{
pr_warn
(
"regmap: Failed to create debugfs root
\n
"
);
return
;
}
mutex_lock
(
&
regmap_debugfs_early_lock
);
list_for_each_entry_safe
(
node
,
tmp
,
&
regmap_debugfs_early_list
,
link
)
{
regmap_debugfs_init
(
node
->
map
,
node
->
name
);
list_del
(
&
node
->
link
);
kfree
(
node
);
}
mutex_unlock
(
&
regmap_debugfs_early_lock
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment