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
3fc7aeeb
Commit
3fc7aeeb
authored
Jul 07, 2015
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pm-wakeirq'
* pm-wakeirq: PM / wakeirq: Avoid setting power.wakeirq too hastily
parents
d770e558
6d3dab7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
28 deletions
+15
-28
drivers/base/power/wakeirq.c
drivers/base/power/wakeirq.c
+5
-7
drivers/base/power/wakeup.c
drivers/base/power/wakeup.c
+10
-21
No files found.
drivers/base/power/wakeirq.c
View file @
3fc7aeeb
...
...
@@ -45,14 +45,12 @@ static int dev_pm_attach_wake_irq(struct device *dev, int irq,
return
-
EEXIST
;
}
dev
->
power
.
wakeirq
=
wirq
;
spin_unlock_irqrestore
(
&
dev
->
power
.
lock
,
flags
);
err
=
device_wakeup_attach_irq
(
dev
,
wirq
);
if
(
err
)
return
err
;
if
(
!
err
)
dev
->
power
.
wakeirq
=
wirq
;
return
0
;
spin_unlock_irqrestore
(
&
dev
->
power
.
lock
,
flags
);
return
err
;
}
/**
...
...
@@ -105,10 +103,10 @@ void dev_pm_clear_wake_irq(struct device *dev)
return
;
spin_lock_irqsave
(
&
dev
->
power
.
lock
,
flags
);
device_wakeup_detach_irq
(
dev
);
dev
->
power
.
wakeirq
=
NULL
;
spin_unlock_irqrestore
(
&
dev
->
power
.
lock
,
flags
);
device_wakeup_detach_irq
(
dev
);
if
(
wirq
->
dedicated_irq
)
free_irq
(
wirq
->
irq
,
wirq
);
kfree
(
wirq
);
...
...
drivers/base/power/wakeup.c
View file @
3fc7aeeb
...
...
@@ -281,32 +281,25 @@ EXPORT_SYMBOL_GPL(device_wakeup_enable);
* Attach a device wakeirq to the wakeup source so the device
* wake IRQ can be configured automatically for suspend and
* resume.
*
* Call under the device's power.lock lock.
*/
int
device_wakeup_attach_irq
(
struct
device
*
dev
,
struct
wake_irq
*
wakeirq
)
{
struct
wakeup_source
*
ws
;
int
ret
=
0
;
spin_lock_irq
(
&
dev
->
power
.
lock
);
ws
=
dev
->
power
.
wakeup
;
if
(
!
ws
)
{
dev_err
(
dev
,
"forgot to call call device_init_wakeup?
\n
"
);
ret
=
-
EINVAL
;
goto
unlock
;
return
-
EINVAL
;
}
if
(
ws
->
wakeirq
)
{
ret
=
-
EEXIST
;
goto
unlock
;
}
if
(
ws
->
wakeirq
)
return
-
EEXIST
;
ws
->
wakeirq
=
wakeirq
;
unlock:
spin_unlock_irq
(
&
dev
->
power
.
lock
);
return
ret
;
return
0
;
}
/**
...
...
@@ -314,20 +307,16 @@ int device_wakeup_attach_irq(struct device *dev,
* @dev: Device to handle
*
* Removes a device wakeirq from the wakeup source.
*
* Call under the device's power.lock lock.
*/
void
device_wakeup_detach_irq
(
struct
device
*
dev
)
{
struct
wakeup_source
*
ws
;
spin_lock_irq
(
&
dev
->
power
.
lock
);
ws
=
dev
->
power
.
wakeup
;
if
(
!
ws
)
goto
unlock
;
ws
->
wakeirq
=
NULL
;
unlock:
spin_unlock_irq
(
&
dev
->
power
.
lock
);
if
(
ws
)
ws
->
wakeirq
=
NULL
;
}
/**
...
...
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