Skip to content

Commit

Permalink
hwmon: (adt7470) No need for additional synchronization on kthread_st…
Browse files Browse the repository at this point in the history
…op()

The kthread_stop() waits for the thread to exit. There is no need for an
additional synchronization needed to join on the kthread.

The completion was added by 89fac11 ("adt7470: make automatic fan
control really work").

Signed-off-by: Daniel Wagner <[email protected]>
Cc: Darrick J. Wong <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Guenter Roeck <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
Daniel Wagner authored and groeck committed Sep 18, 2016
1 parent 0a8784e commit dc8b73e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/hwmon/adt7470.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ struct adt7470_data {
u8 pwm_auto_temp[ADT7470_PWM_COUNT];

struct task_struct *auto_update;
struct completion auto_update_stop;
unsigned int auto_update_interval;
};

Expand Down Expand Up @@ -281,7 +280,6 @@ static int adt7470_update_thread(void *p)
schedule_timeout(msecs_to_jiffies(data->auto_update_interval));
}

complete_all(&data->auto_update_stop);
return 0;
}

Expand Down Expand Up @@ -1356,7 +1354,6 @@ static int adt7470_probe(struct i2c_client *client,
if (IS_ERR(hwmon_dev))
return PTR_ERR(hwmon_dev);

init_completion(&data->auto_update_stop);
data->auto_update = kthread_run(adt7470_update_thread, client, "%s",
dev_name(hwmon_dev));
if (IS_ERR(data->auto_update)) {
Expand All @@ -1371,7 +1368,6 @@ static int adt7470_remove(struct i2c_client *client)
struct adt7470_data *data = i2c_get_clientdata(client);

kthread_stop(data->auto_update);
wait_for_completion(&data->auto_update_stop);
return 0;
}

Expand Down

0 comments on commit dc8b73e

Please sign in to comment.