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
ac58291c
Commit
ac58291c
authored
Feb 06, 2013
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/fix/max77686' into tmp
parents
88b62b91
b19f5758
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
drivers/regulator/max77686.c
drivers/regulator/max77686.c
+8
-7
No files found.
drivers/regulator/max77686.c
View file @
ac58291c
...
...
@@ -379,9 +379,10 @@ static struct regulator_desc regulators[] = {
};
#ifdef CONFIG_OF
static
int
max77686_pmic_dt_parse_pdata
(
struct
max77686_dev
*
io
dev
,
static
int
max77686_pmic_dt_parse_pdata
(
struct
platform_device
*
p
dev
,
struct
max77686_platform_data
*
pdata
)
{
struct
max77686_dev
*
iodev
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
device_node
*
pmic_np
,
*
regulators_np
;
struct
max77686_regulator_data
*
rdata
;
struct
of_regulator_match
rmatch
;
...
...
@@ -390,15 +391,15 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev,
pmic_np
=
iodev
->
dev
->
of_node
;
regulators_np
=
of_find_node_by_name
(
pmic_np
,
"voltage-regulators"
);
if
(
!
regulators_np
)
{
dev_err
(
io
dev
->
dev
,
"could not find regulators sub-node
\n
"
);
dev_err
(
&
p
dev
->
dev
,
"could not find regulators sub-node
\n
"
);
return
-
EINVAL
;
}
pdata
->
num_regulators
=
ARRAY_SIZE
(
regulators
);
rdata
=
devm_kzalloc
(
io
dev
->
dev
,
sizeof
(
*
rdata
)
*
rdata
=
devm_kzalloc
(
&
p
dev
->
dev
,
sizeof
(
*
rdata
)
*
pdata
->
num_regulators
,
GFP_KERNEL
);
if
(
!
rdata
)
{
dev_err
(
io
dev
->
dev
,
dev_err
(
&
p
dev
->
dev
,
"could not allocate memory for regulator data
\n
"
);
return
-
ENOMEM
;
}
...
...
@@ -407,7 +408,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev,
rmatch
.
name
=
regulators
[
i
].
name
;
rmatch
.
init_data
=
NULL
;
rmatch
.
of_node
=
NULL
;
of_regulator_match
(
io
dev
->
dev
,
regulators_np
,
&
rmatch
,
1
);
of_regulator_match
(
&
p
dev
->
dev
,
regulators_np
,
&
rmatch
,
1
);
rdata
[
i
].
initdata
=
rmatch
.
init_data
;
rdata
[
i
].
of_node
=
rmatch
.
of_node
;
}
...
...
@@ -417,7 +418,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev,
return
0
;
}
#else
static
int
max77686_pmic_dt_parse_pdata
(
struct
max77686_dev
*
io
dev
,
static
int
max77686_pmic_dt_parse_pdata
(
struct
platform_device
*
p
dev
,
struct
max77686_platform_data
*
pdata
)
{
return
0
;
...
...
@@ -440,7 +441,7 @@ static int max77686_pmic_probe(struct platform_device *pdev)
}
if
(
iodev
->
dev
->
of_node
)
{
ret
=
max77686_pmic_dt_parse_pdata
(
io
dev
,
pdata
);
ret
=
max77686_pmic_dt_parse_pdata
(
p
dev
,
pdata
);
if
(
ret
)
return
ret
;
}
...
...
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