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
5fe803f5
Commit
5fe803f5
authored
Nov 27, 2011
by
Mark Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ASoC: Convert wm1250-ev1 driver to use devm_kzalloc()
Signed-off-by:
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
parent
997c2ea9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
sound/soc/codecs/wm1250-ev1.c
sound/soc/codecs/wm1250-ev1.c
+3
-7
No files found.
sound/soc/codecs/wm1250-ev1.c
View file @
5fe803f5
...
...
@@ -116,7 +116,7 @@ static int __devinit wm1250_ev1_pdata(struct i2c_client *i2c)
if
(
!
pdata
)
return
0
;
wm1250
=
kzalloc
(
sizeof
(
*
wm1250
),
GFP_KERNEL
);
wm1250
=
devm_kzalloc
(
&
i2c
->
dev
,
sizeof
(
*
wm1250
),
GFP_KERNEL
);
if
(
!
wm1250
)
{
dev_err
(
&
i2c
->
dev
,
"Unable to allocate private data
\n
"
);
ret
=
-
ENOMEM
;
...
...
@@ -134,15 +134,13 @@ static int __devinit wm1250_ev1_pdata(struct i2c_client *i2c)
ret
=
gpio_request_array
(
wm1250
->
gpios
,
ARRAY_SIZE
(
wm1250
->
gpios
));
if
(
ret
!=
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to get GPIOs: %d
\n
"
,
ret
);
goto
err
_alloc
;
goto
err
;
}
dev_set_drvdata
(
&
i2c
->
dev
,
wm1250
);
return
ret
;
err_alloc:
kfree
(
wm1250
);
err:
return
ret
;
}
...
...
@@ -151,10 +149,8 @@ static void wm1250_ev1_free(struct i2c_client *i2c)
{
struct
wm1250_priv
*
wm1250
=
dev_get_drvdata
(
&
i2c
->
dev
);
if
(
wm1250
)
{
if
(
wm1250
)
gpio_free_array
(
wm1250
->
gpios
,
ARRAY_SIZE
(
wm1250
->
gpios
));
kfree
(
wm1250
);
}
}
static
int
__devinit
wm1250_ev1_probe
(
struct
i2c_client
*
i2c
,
...
...
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