Commit 87f818b3 authored by Bhaktipriya Shridhar's avatar Bhaktipriya Shridhar Committed by Sebastian Reichel

power: intel_mid_battery: Remove deprecated create_singlethread_workqueue

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: default avatarBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent d8a69251
...@@ -689,8 +689,7 @@ static int probe(int irq, struct device *dev) ...@@ -689,8 +689,7 @@ static int probe(int irq, struct device *dev)
/* initialize all required framework before enabling interrupts */ /* initialize all required framework before enabling interrupts */
INIT_WORK(&pbi->handler, pmic_battery_handle_intrpt); INIT_WORK(&pbi->handler, pmic_battery_handle_intrpt);
INIT_DELAYED_WORK(&pbi->monitor_battery, pmic_battery_monitor); INIT_DELAYED_WORK(&pbi->monitor_battery, pmic_battery_monitor);
pbi->monitor_wqueue = pbi->monitor_wqueue = alloc_workqueue(dev_name(dev), WQ_MEM_RECLAIM, 0);
create_singlethread_workqueue(dev_name(dev));
if (!pbi->monitor_wqueue) { if (!pbi->monitor_wqueue) {
dev_err(dev, "%s(): wqueue init failed\n", __func__); dev_err(dev, "%s(): wqueue init failed\n", __func__);
retval = -ESRCH; retval = -ESRCH;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment