aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_pad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpi_pad.c')
-rw-r--r--drivers/acpi/acpi_pad.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index 6230637054c6..fc6008fbce35 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -231,16 +231,19 @@ static struct task_struct *ps_tsks[NR_CPUS];
231static unsigned int ps_tsk_num; 231static unsigned int ps_tsk_num;
232static int create_power_saving_task(void) 232static int create_power_saving_task(void)
233{ 233{
234 int rc = -ENOMEM; 234 int rc;
235 235
236 ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread, 236 ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread,
237 (void *)(unsigned long)ps_tsk_num, 237 (void *)(unsigned long)ps_tsk_num,
238 "acpi_pad/%d", ps_tsk_num); 238 "acpi_pad/%d", ps_tsk_num);
239 rc = PTR_RET(ps_tsks[ps_tsk_num]); 239
240 if (!rc) 240 if (IS_ERR(ps_tsks[ps_tsk_num])) {
241 ps_tsk_num++; 241 rc = PTR_ERR(ps_tsks[ps_tsk_num]);
242 else
243 ps_tsks[ps_tsk_num] = NULL; 242 ps_tsks[ps_tsk_num] = NULL;
243 } else {
244 rc = 0;
245 ps_tsk_num++;
246 }
244 247
245 return rc; 248 return rc;
246} 249}