diff options
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index 71dcc410f9d0..bfa9c726054a 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -940,7 +940,6 @@ static int ips_monitor(void *data) | |||
940 | kfree(mch_samples); | 940 | kfree(mch_samples); |
941 | kfree(cpu_samples); | 941 | kfree(cpu_samples); |
942 | kfree(mchp_samples); | 942 | kfree(mchp_samples); |
943 | kthread_stop(ips->adjust); | ||
944 | return -ENOMEM; | 943 | return -ENOMEM; |
945 | } | 944 | } |
946 | 945 | ||
@@ -1535,19 +1534,24 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1535 | ips_enable_cpu_turbo(ips); | 1534 | ips_enable_cpu_turbo(ips); |
1536 | ips->cpu_turbo_enabled = true; | 1535 | ips->cpu_turbo_enabled = true; |
1537 | 1536 | ||
1538 | /* Set up the work queue and monitor/adjust threads */ | 1537 | /* Create thermal adjust thread */ |
1539 | ips->monitor = kthread_run(ips_monitor, ips, "ips-monitor"); | 1538 | ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust"); |
1540 | if (IS_ERR(ips->monitor)) { | 1539 | if (IS_ERR(ips->adjust)) { |
1541 | dev_err(&dev->dev, | 1540 | dev_err(&dev->dev, |
1542 | "failed to create thermal monitor thread, aborting\n"); | 1541 | "failed to create thermal adjust thread, aborting\n"); |
1543 | ret = -ENOMEM; | 1542 | ret = -ENOMEM; |
1544 | goto error_free_irq; | 1543 | goto error_free_irq; |
1544 | |||
1545 | } | 1545 | } |
1546 | 1546 | ||
1547 | ips->adjust = kthread_create(ips_adjust, ips, "ips-adjust"); | 1547 | /* |
1548 | if (IS_ERR(ips->adjust)) { | 1548 | * Set up the work queue and monitor thread. The monitor thread |
1549 | * will wake up ips_adjust thread. | ||
1550 | */ | ||
1551 | ips->monitor = kthread_run(ips_monitor, ips, "ips-monitor"); | ||
1552 | if (IS_ERR(ips->monitor)) { | ||
1549 | dev_err(&dev->dev, | 1553 | dev_err(&dev->dev, |
1550 | "failed to create thermal adjust thread, aborting\n"); | 1554 | "failed to create thermal monitor thread, aborting\n"); |
1551 | ret = -ENOMEM; | 1555 | ret = -ENOMEM; |
1552 | goto error_thread_cleanup; | 1556 | goto error_thread_cleanup; |
1553 | } | 1557 | } |
@@ -1566,7 +1570,7 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1566 | return ret; | 1570 | return ret; |
1567 | 1571 | ||
1568 | error_thread_cleanup: | 1572 | error_thread_cleanup: |
1569 | kthread_stop(ips->monitor); | 1573 | kthread_stop(ips->adjust); |
1570 | error_free_irq: | 1574 | error_free_irq: |
1571 | free_irq(ips->dev->irq, ips); | 1575 | free_irq(ips->dev->irq, ips); |
1572 | error_unmap: | 1576 | error_unmap: |