Commit eb1e40a4 authored by Tejun Heo's avatar Tejun Heo Committed by Greg Kroah-Hartman

staging: nvec: use system_nrt_wq instead of custom one

There isn't much reason to use custom workqueue in nvec.  It can use
system_nrt_wq instead and cancel the two work items on removal.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarMarc Dietrich <marvin24@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 71d64ef2
...@@ -264,7 +264,7 @@ int nvec_write_async(struct nvec_chip *nvec, const unsigned char *data, ...@@ -264,7 +264,7 @@ int nvec_write_async(struct nvec_chip *nvec, const unsigned char *data,
list_add_tail(&msg->node, &nvec->tx_data); list_add_tail(&msg->node, &nvec->tx_data);
spin_unlock_irqrestore(&nvec->tx_lock, flags); spin_unlock_irqrestore(&nvec->tx_lock, flags);
queue_work(nvec->wq, &nvec->tx_work); queue_work(system_nrt_wq, &nvec->tx_work);
return 0; return 0;
} }
...@@ -471,7 +471,7 @@ static void nvec_rx_completed(struct nvec_chip *nvec) ...@@ -471,7 +471,7 @@ static void nvec_rx_completed(struct nvec_chip *nvec)
if (!nvec_msg_is_event(nvec->rx)) if (!nvec_msg_is_event(nvec->rx))
complete(&nvec->ec_transfer); complete(&nvec->ec_transfer);
queue_work(nvec->wq, &nvec->rx_work); queue_work(system_nrt_wq, &nvec->rx_work);
} }
/** /**
...@@ -794,13 +794,11 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev) ...@@ -794,13 +794,11 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&nvec->tx_data); INIT_LIST_HEAD(&nvec->tx_data);
INIT_WORK(&nvec->rx_work, nvec_dispatch); INIT_WORK(&nvec->rx_work, nvec_dispatch);
INIT_WORK(&nvec->tx_work, nvec_request_master); INIT_WORK(&nvec->tx_work, nvec_request_master);
nvec->wq = alloc_workqueue("nvec", WQ_NON_REENTRANT, 2);
err = devm_gpio_request_one(&pdev->dev, nvec->gpio, GPIOF_OUT_INIT_HIGH, err = devm_gpio_request_one(&pdev->dev, nvec->gpio, GPIOF_OUT_INIT_HIGH,
"nvec gpio"); "nvec gpio");
if (err < 0) { if (err < 0) {
dev_err(nvec->dev, "couldn't request gpio\n"); dev_err(nvec->dev, "couldn't request gpio\n");
destroy_workqueue(nvec->wq);
return -ENODEV; return -ENODEV;
} }
...@@ -808,7 +806,6 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev) ...@@ -808,7 +806,6 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev)
"nvec", nvec); "nvec", nvec);
if (err) { if (err) {
dev_err(nvec->dev, "couldn't request irq\n"); dev_err(nvec->dev, "couldn't request irq\n");
destroy_workqueue(nvec->wq);
return -ENODEV; return -ENODEV;
} }
disable_irq(nvec->irq); disable_irq(nvec->irq);
...@@ -862,7 +859,8 @@ static int __devexit tegra_nvec_remove(struct platform_device *pdev) ...@@ -862,7 +859,8 @@ static int __devexit tegra_nvec_remove(struct platform_device *pdev)
nvec_write_async(nvec, EC_DISABLE_EVENT_REPORTING, 3); nvec_write_async(nvec, EC_DISABLE_EVENT_REPORTING, 3);
mfd_remove_devices(nvec->dev); mfd_remove_devices(nvec->dev);
destroy_workqueue(nvec->wq); cancel_work_sync(&nvec->rx_work);
cancel_work_sync(&nvec->tx_work);
return 0; return 0;
} }
......
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