Skip to content

Commit c96b817

Browse files
damien-lemoalaxboe
authored andcommitted
block: Remove blk_set_runtime_active()
The function blk_set_runtime_active() is called only from blk_post_runtime_resume(), so there is no need for that function to be exported. Open-code this function directly in blk_post_runtime_resume() and remove it. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent c2da049 commit c96b817

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

block/blk-pm.c

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -163,38 +163,15 @@ EXPORT_SYMBOL(blk_pre_runtime_resume);
163163
* @q: the queue of the device
164164
*
165165
* Description:
166-
* For historical reasons, this routine merely calls blk_set_runtime_active()
167-
* to do the real work of restarting the queue. It does this regardless of
168-
* whether the device's runtime-resume succeeded; even if it failed the
166+
* Restart the queue of a runtime suspended device. It does this regardless
167+
* of whether the device's runtime-resume succeeded; even if it failed the
169168
* driver or error handler will need to communicate with the device.
170169
*
171170
* This function should be called near the end of the device's
172-
* runtime_resume callback.
171+
* runtime_resume callback to correct queue runtime PM status and re-enable
172+
* peeking requests from the queue.
173173
*/
174174
void blk_post_runtime_resume(struct request_queue *q)
175-
{
176-
blk_set_runtime_active(q);
177-
}
178-
EXPORT_SYMBOL(blk_post_runtime_resume);
179-
180-
/**
181-
* blk_set_runtime_active - Force runtime status of the queue to be active
182-
* @q: the queue of the device
183-
*
184-
* If the device is left runtime suspended during system suspend the resume
185-
* hook typically resumes the device and corrects runtime status
186-
* accordingly. However, that does not affect the queue runtime PM status
187-
* which is still "suspended". This prevents processing requests from the
188-
* queue.
189-
*
190-
* This function can be used in driver's resume hook to correct queue
191-
* runtime PM status and re-enable peeking requests from the queue. It
192-
* should be called before first request is added to the queue.
193-
*
194-
* This function is also called by blk_post_runtime_resume() for
195-
* runtime resumes. It does everything necessary to restart the queue.
196-
*/
197-
void blk_set_runtime_active(struct request_queue *q)
198175
{
199176
int old_status;
200177

@@ -211,4 +188,4 @@ void blk_set_runtime_active(struct request_queue *q)
211188
if (old_status != RPM_ACTIVE)
212189
blk_clear_pm_only(q);
213190
}
214-
EXPORT_SYMBOL(blk_set_runtime_active);
191+
EXPORT_SYMBOL(blk_post_runtime_resume);

include/linux/blk-pm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ extern int blk_pre_runtime_suspend(struct request_queue *q);
1515
extern void blk_post_runtime_suspend(struct request_queue *q, int err);
1616
extern void blk_pre_runtime_resume(struct request_queue *q);
1717
extern void blk_post_runtime_resume(struct request_queue *q);
18-
extern void blk_set_runtime_active(struct request_queue *q);
1918
#else
2019
static inline void blk_pm_runtime_init(struct request_queue *q,
2120
struct device *dev) {}

0 commit comments

Comments
 (0)