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
Kirill Smelkov
linux
Commits
8798975b
Commit
8798975b
authored
Jan 05, 2016
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regmap/topic/core' into regmap-next
parents
6cca6712
fcac0233
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
23 deletions
+25
-23
drivers/base/regmap/regcache-flat.c
drivers/base/regmap/regcache-flat.c
+1
-1
drivers/base/regmap/regcache-lzo.c
drivers/base/regmap/regcache-lzo.c
+3
-3
drivers/base/regmap/regcache-rbtree.c
drivers/base/regmap/regcache-rbtree.c
+5
-4
drivers/base/regmap/regmap-irq.c
drivers/base/regmap/regmap-irq.c
+7
-6
drivers/base/regmap/regmap.c
drivers/base/regmap/regmap.c
+8
-8
include/linux/regmap.h
include/linux/regmap.h
+1
-1
No files found.
drivers/base/regmap/regcache-flat.c
View file @
8798975b
...
...
@@ -21,7 +21,7 @@ static int regcache_flat_init(struct regmap *map)
int
i
;
unsigned
int
*
cache
;
map
->
cache
=
k
zalloc
(
sizeof
(
unsigned
int
)
*
(
map
->
max_register
+
1
),
map
->
cache
=
k
calloc
(
map
->
max_register
+
1
,
sizeof
(
unsigned
int
),
GFP_KERNEL
);
if
(
!
map
->
cache
)
return
-
ENOMEM
;
...
...
drivers/base/regmap/regcache-lzo.c
View file @
8798975b
...
...
@@ -139,7 +139,7 @@ static int regcache_lzo_init(struct regmap *map)
ret
=
0
;
blkcount
=
regcache_lzo_block_count
(
map
);
map
->
cache
=
k
zalloc
(
blkcount
*
sizeof
*
lzo_blocks
,
map
->
cache
=
k
calloc
(
blkcount
,
sizeof
(
*
lzo_blocks
)
,
GFP_KERNEL
);
if
(
!
map
->
cache
)
return
-
ENOMEM
;
...
...
@@ -152,8 +152,8 @@ static int regcache_lzo_init(struct regmap *map)
* that register.
*/
bmp_size
=
map
->
num_reg_defaults_raw
;
sync_bmp
=
kmalloc
(
BITS_TO_LONGS
(
bmp_size
)
*
sizeof
(
long
),
GFP_KERNEL
);
sync_bmp
=
kmalloc
_array
(
BITS_TO_LONGS
(
bmp_size
),
sizeof
(
long
),
GFP_KERNEL
);
if
(
!
sync_bmp
)
{
ret
=
-
ENOMEM
;
goto
err
;
...
...
drivers/base/regmap/regcache-rbtree.c
View file @
8798975b
...
...
@@ -361,13 +361,14 @@ regcache_rbtree_node_alloc(struct regmap *map, unsigned int reg)
rbnode
->
base_reg
=
reg
;
}
rbnode
->
block
=
kmalloc
(
rbnode
->
blklen
*
map
->
cache_word_size
,
GFP_KERNEL
);
rbnode
->
block
=
kmalloc
_array
(
rbnode
->
blklen
,
map
->
cache_word_size
,
GFP_KERNEL
);
if
(
!
rbnode
->
block
)
goto
err_free
;
rbnode
->
cache_present
=
kzalloc
(
BITS_TO_LONGS
(
rbnode
->
blklen
)
*
sizeof
(
*
rbnode
->
cache_present
),
GFP_KERNEL
);
rbnode
->
cache_present
=
kcalloc
(
BITS_TO_LONGS
(
rbnode
->
blklen
),
sizeof
(
*
rbnode
->
cache_present
),
GFP_KERNEL
);
if
(
!
rbnode
->
cache_present
)
goto
err_free_block
;
...
...
drivers/base/regmap/regmap-irq.c
View file @
8798975b
...
...
@@ -386,23 +386,23 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
if
(
!
d
)
return
-
ENOMEM
;
d
->
status_buf
=
k
zalloc
(
sizeof
(
unsigned
int
)
*
chip
->
num_regs
,
d
->
status_buf
=
k
calloc
(
chip
->
num_regs
,
sizeof
(
unsigned
int
)
,
GFP_KERNEL
);
if
(
!
d
->
status_buf
)
goto
err_alloc
;
d
->
mask_buf
=
k
zalloc
(
sizeof
(
unsigned
int
)
*
chip
->
num_regs
,
d
->
mask_buf
=
k
calloc
(
chip
->
num_regs
,
sizeof
(
unsigned
int
)
,
GFP_KERNEL
);
if
(
!
d
->
mask_buf
)
goto
err_alloc
;
d
->
mask_buf_def
=
k
zalloc
(
sizeof
(
unsigned
int
)
*
chip
->
num_regs
,
d
->
mask_buf_def
=
k
calloc
(
chip
->
num_regs
,
sizeof
(
unsigned
int
)
,
GFP_KERNEL
);
if
(
!
d
->
mask_buf_def
)
goto
err_alloc
;
if
(
chip
->
wake_base
)
{
d
->
wake_buf
=
k
zalloc
(
sizeof
(
unsigned
int
)
*
chip
->
num_regs
,
d
->
wake_buf
=
k
calloc
(
chip
->
num_regs
,
sizeof
(
unsigned
int
)
,
GFP_KERNEL
);
if
(
!
d
->
wake_buf
)
goto
err_alloc
;
...
...
@@ -422,8 +422,9 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
if
(
!
map
->
use_single_read
&&
map
->
reg_stride
==
1
&&
d
->
irq_reg_stride
==
1
)
{
d
->
status_reg_buf
=
kmalloc
(
map
->
format
.
val_bytes
*
chip
->
num_regs
,
GFP_KERNEL
);
d
->
status_reg_buf
=
kmalloc_array
(
chip
->
num_regs
,
map
->
format
.
val_bytes
,
GFP_KERNEL
);
if
(
!
d
->
status_reg_buf
)
goto
err_alloc
;
}
...
...
drivers/base/regmap/regmap.c
View file @
8798975b
...
...
@@ -1513,7 +1513,7 @@ int regmap_write(struct regmap *map, unsigned int reg, unsigned int val)
{
int
ret
;
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
map
->
lock
(
map
->
lock_arg
);
...
...
@@ -1540,7 +1540,7 @@ int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val)
{
int
ret
;
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
map
->
lock
(
map
->
lock_arg
);
...
...
@@ -1714,7 +1714,7 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
if
(
map
->
bus
&&
!
map
->
format
.
parse_inplace
)
return
-
EINVAL
;
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
/*
...
...
@@ -1983,7 +1983,7 @@ static int _regmap_multi_reg_write(struct regmap *map,
int
reg
=
regs
[
i
].
reg
;
if
(
!
map
->
writeable_reg
(
map
->
dev
,
reg
))
return
-
EINVAL
;
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
}
...
...
@@ -2133,7 +2133,7 @@ int regmap_raw_write_async(struct regmap *map, unsigned int reg,
if
(
val_len
%
map
->
format
.
val_bytes
)
return
-
EINVAL
;
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
map
->
lock
(
map
->
lock_arg
);
...
...
@@ -2260,7 +2260,7 @@ int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val)
{
int
ret
;
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
map
->
lock
(
map
->
lock_arg
);
...
...
@@ -2296,7 +2296,7 @@ int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
return
-
EINVAL
;
if
(
val_len
%
map
->
format
.
val_bytes
)
return
-
EINVAL
;
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
if
(
val_count
==
0
)
return
-
EINVAL
;
...
...
@@ -2414,7 +2414,7 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
size_t
val_bytes
=
map
->
format
.
val_bytes
;
bool
vol
=
regmap_volatile_range
(
map
,
reg
,
val_count
);
if
(
reg
%
map
->
reg_stride
)
if
(
!
IS_ALIGNED
(
reg
,
map
->
reg_stride
)
)
return
-
EINVAL
;
if
(
map
->
bus
&&
map
->
format
.
parse_inplace
&&
(
vol
||
map
->
cache_type
==
REGCACHE_NONE
))
{
...
...
include/linux/regmap.h
View file @
8798975b
...
...
@@ -1021,7 +1021,7 @@ static inline void regmap_async_complete(struct regmap *map)
}
static
inline
int
regmap_register_patch
(
struct
regmap
*
map
,
const
struct
reg_
default
*
regs
,
const
struct
reg_
sequence
*
regs
,
int
num_regs
)
{
WARN_ONCE
(
1
,
"regmap API is disabled"
);
...
...
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