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
c45bb35f
Commit
c45bb35f
authored
Mar 21, 2012
by
Mark Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regulator: fixed: Use devm_kzalloc()
Signed-off-by:
Mark Brown
<
broonie@opensource.wolfsonmicro.com
>
parent
33426e97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
drivers/regulator/fixed.c
drivers/regulator/fixed.c
+2
-3
No files found.
drivers/regulator/fixed.c
View file @
c45bb35f
...
...
@@ -176,7 +176,8 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
if
(
!
config
)
return
-
ENOMEM
;
drvdata
=
kzalloc
(
sizeof
(
struct
fixed_voltage_data
),
GFP_KERNEL
);
drvdata
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
struct
fixed_voltage_data
),
GFP_KERNEL
);
if
(
drvdata
==
NULL
)
{
dev_err
(
&
pdev
->
dev
,
"Failed to allocate device data
\n
"
);
ret
=
-
ENOMEM
;
...
...
@@ -270,7 +271,6 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
err_name:
kfree
(
drvdata
->
desc
.
name
);
err:
kfree
(
drvdata
);
return
ret
;
}
...
...
@@ -282,7 +282,6 @@ static int __devexit reg_fixed_voltage_remove(struct platform_device *pdev)
if
(
gpio_is_valid
(
drvdata
->
gpio
))
gpio_free
(
drvdata
->
gpio
);
kfree
(
drvdata
->
desc
.
name
);
kfree
(
drvdata
);
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