power: ipaq_micro_battery: Remove deprecated create_singlethread_workqueue
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Sat, 13 Aug 2016 16:33:53 +0000 (22:03 +0530)
committerSebastian Reichel <sre@kernel.org>
Mon, 15 Aug 2016 22:54:37 +0000 (00:54 +0200)
The workqueue "wq" is used for handling battery related tasks.

It has a single work item viz &mb->update and hence it doesn't require
execution ordering. Hence, alloc_workqueue has been used to replace the
deprecated create_singlethread_workqueue instance.

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 <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/ipaq_micro_battery.c

index 35b01c7d775b45c00f5ed98549c216f744f155a0..4af7b770f293957e12234fbde112c33ccb72cdbb 100644 (file)
@@ -235,7 +235,7 @@ static int micro_batt_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        mb->micro = dev_get_drvdata(pdev->dev.parent);
-       mb->wq = create_singlethread_workqueue("ipaq-battery-wq");
+       mb->wq = alloc_workqueue("ipaq-battery-wq", WQ_MEM_RECLAIM, 0);
        if (!mb->wq)
                return -ENOMEM;