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
b03e96e4
Commit
b03e96e4
authored
Dec 02, 2011
by
Mark Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ASoC: Convert WM2000 to devm_kzalloc()
Signed-off-by:
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
parent
6cd4eb95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
sound/soc/codecs/wm2000.c
sound/soc/codecs/wm2000.c
+5
-5
No files found.
sound/soc/codecs/wm2000.c
View file @
b03e96e4
...
...
@@ -740,7 +740,8 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
return
-
EINVAL
;
}
wm2000
=
kzalloc
(
sizeof
(
struct
wm2000_priv
),
GFP_KERNEL
);
wm2000
=
devm_kzalloc
(
&
i2c
->
dev
,
sizeof
(
struct
wm2000_priv
),
GFP_KERNEL
);
if
(
wm2000
==
NULL
)
{
dev_err
(
&
i2c
->
dev
,
"Unable to allocate private data
\n
"
);
return
-
ENOMEM
;
...
...
@@ -779,7 +780,9 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
/* Pre-cook the concatenation of the register address onto the image */
wm2000
->
anc_download_size
=
fw
->
size
+
2
;
wm2000
->
anc_download
=
kmalloc
(
wm2000
->
anc_download_size
,
GFP_KERNEL
);
wm2000
->
anc_download
=
devm_kzalloc
(
&
i2c
->
dev
,
wm2000
->
anc_download_size
,
GFP_KERNEL
);
if
(
wm2000
->
anc_download
==
NULL
)
{
dev_err
(
&
i2c
->
dev
,
"Out of memory
\n
"
);
ret
=
-
ENOMEM
;
...
...
@@ -810,7 +813,6 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
err_fw:
release_firmware
(
fw
);
err:
kfree
(
wm2000
);
return
ret
;
}
...
...
@@ -821,8 +823,6 @@ static __devexit int wm2000_i2c_remove(struct i2c_client *i2c)
wm2000_anc_transition
(
wm2000
,
ANC_OFF
);
wm2000_i2c
=
NULL
;
kfree
(
wm2000
->
anc_download
);
kfree
(
wm2000
);
return
0
;
}
...
...
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