Skip to content

Commit

Permalink
power: ds2760_battery: 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 "monitor_wqueue" is used to monitor the battery
status. It has been identity converted.

It queues multiple work items viz &di->monitor_work,
&di->set_charged_work, which require execution ordering.
Hence, alloc_workqueue has been used to replace the
deprecated create_singlethread_workqueue instance.

WQ_MEM_RECLAIM flag has been set to ensure 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 1c53f37 commit b732ace
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/power/supply/ds2760_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ static int ds2760_battery_probe(struct platform_device *pdev)
INIT_DELAYED_WORK(&di->monitor_work, ds2760_battery_work);
INIT_DELAYED_WORK(&di->set_charged_work,
ds2760_battery_set_charged_work);
di->monitor_wqueue = create_singlethread_workqueue(dev_name(&pdev->dev));
di->monitor_wqueue = alloc_ordered_workqueue(dev_name(&pdev->dev),
WQ_MEM_RECLAIM);
if (!di->monitor_wqueue) {
retval = -ESRCH;
goto workqueue_failed;
Expand Down

0 comments on commit b732ace

Please sign in to comment.