Skip to content

Commit

Permalink
power: ab8500_fg: Remove deprecated create_singlethread_workqueue
Browse files Browse the repository at this point in the history
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "fg_wq" is used for running the FG algorithm periodically.
It has been identity converted.

It has multiple work items viz fg_periodic_work, fg_low_bat_work,
fg_reinit_work, fg_work, fg_acc_cur_work and fg_check_hw_failure_work,
which require execution ordering. Hence, a dedicated ordered workqueue
has been used here.

The WQ_MEM_RECLAIM flag has been set to guarantee forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
  • Loading branch information
bhaktipriya authored and sre committed Aug 15, 2016
1 parent 829f0e9 commit 1c53f37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/ab8500_fg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3096,7 +3096,7 @@ static int ab8500_fg_probe(struct platform_device *pdev)
ab8500_fg_discharge_state_to(di, AB8500_FG_DISCHARGE_INIT);

/* Create a work queue for running the FG algorithm */
di->fg_wq = create_singlethread_workqueue("ab8500_fg_wq");
di->fg_wq = alloc_ordered_workqueue("ab8500_fg_wq", WQ_MEM_RECLAIM);
if (di->fg_wq == NULL) {
dev_err(di->dev, "failed to create work queue\n");
return -ENOMEM;
Expand Down

0 comments on commit 1c53f37

Please sign in to comment.