Skip to content

Commit

Permalink
power: intel_mid_battery: Remove deprecated create_singlethread_workq…
Browse files Browse the repository at this point in the history
…ueue

The workqueue "monitor_wqueue" is used to monitor the PMIC battery status.
It queues a single work item (pbi->monitor_battery) and hence doesn't
require ordering. Hence, alloc_workqueue has been used to replace the
deprecated create_singlethread_workqueue instance.

Since PMIC battery status needs to be monitored for any change, the
WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory
pressure.

Since there is a single work item, explicit concurrency
limit is unnecessary here.

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 d8a6925 commit 87f818b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/power/supply/intel_mid_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,7 @@ static int probe(int irq, struct device *dev)
/* initialize all required framework before enabling interrupts */
INIT_WORK(&pbi->handler, pmic_battery_handle_intrpt);
INIT_DELAYED_WORK(&pbi->monitor_battery, pmic_battery_monitor);
pbi->monitor_wqueue =
create_singlethread_workqueue(dev_name(dev));
pbi->monitor_wqueue = alloc_workqueue(dev_name(dev), WQ_MEM_RECLAIM, 0);
if (!pbi->monitor_wqueue) {
dev_err(dev, "%s(): wqueue init failed\n", __func__);
retval = -ESRCH;
Expand Down

0 comments on commit 87f818b

Please sign in to comment.