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
eaf018e1
Commit
eaf018e1
authored
Aug 30, 2015
by
Mark Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'regulator/topic/core' into regulator-next
parents
e616e2f1
099982fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
drivers/regulator/core.c
drivers/regulator/core.c
+18
-4
No files found.
drivers/regulator/core.c
View file @
eaf018e1
...
...
@@ -296,7 +296,7 @@ static int regulator_check_drms(struct regulator_dev *rdev)
return
-
ENODEV
;
}
if
(
!
(
rdev
->
constraints
->
valid_ops_mask
&
REGULATOR_CHANGE_DRMS
))
{
rdev_
err
(
rdev
,
"operation not allowed
\n
"
);
rdev_
dbg
(
rdev
,
"operation not allowed
\n
"
);
return
-
EPERM
;
}
return
0
;
...
...
@@ -641,6 +641,8 @@ static int drms_uA_update(struct regulator_dev *rdev)
int
current_uA
=
0
,
output_uV
,
input_uV
,
err
;
unsigned
int
mode
;
lockdep_assert_held_once
(
&
rdev
->
mutex
);
/*
* first check to see if we can set modes at all, otherwise just
* tell the consumer everything is OK.
...
...
@@ -761,6 +763,8 @@ static int suspend_set_state(struct regulator_dev *rdev,
/* locks held by caller */
static
int
suspend_prepare
(
struct
regulator_dev
*
rdev
,
suspend_state_t
state
)
{
lockdep_assert_held_once
(
&
rdev
->
mutex
);
if
(
!
rdev
->
constraints
)
return
-
EINVAL
;
...
...
@@ -1595,9 +1599,11 @@ static void _regulator_put(struct regulator *regulator)
{
struct
regulator_dev
*
rdev
;
if
(
regulator
==
NULL
||
IS_ERR
(
regulator
))
if
(
IS_ERR_OR_NULL
(
regulator
))
return
;
lockdep_assert_held_once
(
&
regulator_list_mutex
);
rdev
=
regulator
->
rdev
;
debugfs_remove_recursive
(
regulator
->
debugfs
);
...
...
@@ -1976,6 +1982,8 @@ static int _regulator_enable(struct regulator_dev *rdev)
{
int
ret
;
lockdep_assert_held_once
(
&
rdev
->
mutex
);
/* check voltage and requested load before enabling */
if
(
rdev
->
constraints
&&
(
rdev
->
constraints
->
valid_ops_mask
&
REGULATOR_CHANGE_DRMS
))
...
...
@@ -2076,6 +2084,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
{
int
ret
=
0
;
lockdep_assert_held_once
(
&
rdev
->
mutex
);
if
(
WARN
(
rdev
->
use_count
<=
0
,
"unbalanced disables for %s
\n
"
,
rdev_get_name
(
rdev
)))
return
-
EIO
;
...
...
@@ -2154,6 +2164,8 @@ static int _regulator_force_disable(struct regulator_dev *rdev)
{
int
ret
=
0
;
lockdep_assert_held_once
(
&
rdev
->
mutex
);
ret
=
_notifier_call_chain
(
rdev
,
REGULATOR_EVENT_FORCE_DISABLE
|
REGULATOR_EVENT_PRE_DISABLE
,
NULL
);
if
(
ret
&
NOTIFY_STOP_MASK
)
...
...
@@ -2722,7 +2734,7 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV)
goto
out
;
/* If we're trying to set a range that overlaps the current voltage,
* return succesfully even though the regulator does not support
* return succes
s
fully even though the regulator does not support
* changing the voltage.
*/
if
(
!
(
rdev
->
constraints
->
valid_ops_mask
&
REGULATOR_CHANGE_VOLTAGE
))
{
...
...
@@ -3450,6 +3462,8 @@ EXPORT_SYMBOL_GPL(regulator_bulk_free);
int
regulator_notifier_call_chain
(
struct
regulator_dev
*
rdev
,
unsigned
long
event
,
void
*
data
)
{
lockdep_assert_held_once
(
&
rdev
->
mutex
);
_notifier_call_chain
(
rdev
,
event
,
data
);
return
NOTIFY_DONE
;
...
...
@@ -3824,11 +3838,11 @@ void regulator_unregister(struct regulator_dev *rdev)
WARN_ON
(
rdev
->
open_count
);
unset_regulator_supplies
(
rdev
);
list_del
(
&
rdev
->
list
);
mutex_unlock
(
&
regulator_list_mutex
);
kfree
(
rdev
->
constraints
);
regulator_ena_gpio_free
(
rdev
);
of_node_put
(
rdev
->
dev
.
of_node
);
device_unregister
(
&
rdev
->
dev
);
mutex_unlock
(
&
regulator_list_mutex
);
}
EXPORT_SYMBOL_GPL
(
regulator_unregister
);
...
...
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