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
8fed54ae
Commit
8fed54ae
authored
Sep 22, 2012
by
Mark Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ASoC: wm2000: Convert to devm_regmap_init_i2c()
Signed-off-by:
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
parent
ddfb43f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
sound/soc/codecs/wm2000.c
sound/soc/codecs/wm2000.c
+4
-9
No files found.
sound/soc/codecs/wm2000.c
View file @
8fed54ae
...
@@ -760,7 +760,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
...
@@ -760,7 +760,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
dev_set_drvdata
(
&
i2c
->
dev
,
wm2000
);
dev_set_drvdata
(
&
i2c
->
dev
,
wm2000
);
wm2000
->
regmap
=
regmap_init_i2c
(
i2c
,
&
wm2000_regmap
);
wm2000
->
regmap
=
devm_
regmap_init_i2c
(
i2c
,
&
wm2000_regmap
);
if
(
IS_ERR
(
wm2000
->
regmap
))
{
if
(
IS_ERR
(
wm2000
->
regmap
))
{
ret
=
PTR_ERR
(
wm2000
->
regmap
);
ret
=
PTR_ERR
(
wm2000
->
regmap
);
dev_err
(
&
i2c
->
dev
,
"Failed to allocate register map: %d
\n
"
,
dev_err
(
&
i2c
->
dev
,
"Failed to allocate register map: %d
\n
"
,
...
@@ -777,7 +777,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
...
@@ -777,7 +777,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
if
(
id
!=
0x2000
)
{
if
(
id
!=
0x2000
)
{
dev_err
(
&
i2c
->
dev
,
"Device is not a WM2000 - ID %x
\n
"
,
id
);
dev_err
(
&
i2c
->
dev
,
"Device is not a WM2000 - ID %x
\n
"
,
id
);
ret
=
-
ENODEV
;
ret
=
-
ENODEV
;
goto
out
_regmap_exit
;
goto
out
;
}
}
reg
=
wm2000_read
(
i2c
,
WM2000_REG_REVISON
);
reg
=
wm2000_read
(
i2c
,
WM2000_REG_REVISON
);
...
@@ -796,7 +796,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
...
@@ -796,7 +796,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
ret
=
request_firmware
(
&
fw
,
filename
,
&
i2c
->
dev
);
ret
=
request_firmware
(
&
fw
,
filename
,
&
i2c
->
dev
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
dev_err
(
&
i2c
->
dev
,
"Failed to acquire ANC data: %d
\n
"
,
ret
);
dev_err
(
&
i2c
->
dev
,
"Failed to acquire ANC data: %d
\n
"
,
ret
);
goto
out
_regmap_exit
;
goto
out
;
}
}
/* Pre-cook the concatenation of the register address onto the image */
/* Pre-cook the concatenation of the register address onto the image */
...
@@ -807,7 +807,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
...
@@ -807,7 +807,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
if
(
wm2000
->
anc_download
==
NULL
)
{
if
(
wm2000
->
anc_download
==
NULL
)
{
dev_err
(
&
i2c
->
dev
,
"Out of memory
\n
"
);
dev_err
(
&
i2c
->
dev
,
"Out of memory
\n
"
);
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
out
_regmap_exit
;
goto
out
;
}
}
wm2000
->
anc_download
[
0
]
=
0x80
;
wm2000
->
anc_download
[
0
]
=
0x80
;
...
@@ -825,8 +825,6 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
...
@@ -825,8 +825,6 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
if
(
!
ret
)
if
(
!
ret
)
goto
out
;
goto
out
;
out_regmap_exit:
regmap_exit
(
wm2000
->
regmap
);
out:
out:
release_firmware
(
fw
);
release_firmware
(
fw
);
return
ret
;
return
ret
;
...
@@ -834,10 +832,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
...
@@ -834,10 +832,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c,
static
__devexit
int
wm2000_i2c_remove
(
struct
i2c_client
*
i2c
)
static
__devexit
int
wm2000_i2c_remove
(
struct
i2c_client
*
i2c
)
{
{
struct
wm2000_priv
*
wm2000
=
dev_get_drvdata
(
&
i2c
->
dev
);
snd_soc_unregister_codec
(
&
i2c
->
dev
);
snd_soc_unregister_codec
(
&
i2c
->
dev
);
regmap_exit
(
wm2000
->
regmap
);
return
0
;
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