From patchwork Fri Sep 16 08:07:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 9335119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8FDBA601C2 for ; Fri, 16 Sep 2016 08:16:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 824A029EEE for ; Fri, 16 Sep 2016 08:16:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76D7529EF3; Fri, 16 Sep 2016 08:16:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7E7829EEE for ; Fri, 16 Sep 2016 08:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755769AbcIPIQa (ORCPT ); Fri, 16 Sep 2016 04:16:30 -0400 Received: from atlantic540.startdedicated.de ([188.138.9.77]:54851 "EHLO atlantic540.startdedicated.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753907AbcIPIQ3 (ORCPT ); Fri, 16 Sep 2016 04:16:29 -0400 X-Greylist: delayed 527 seconds by postgrey-1.27 at vger.kernel.org; Fri, 16 Sep 2016 04:16:29 EDT Received: from atlantic540.startdedicated.de (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id D05F0500523; Fri, 16 Sep 2016 10:07:40 +0200 (CEST) Received: from localhost (unknown [212.118.206.70]) by atlantic540.startdedicated.de (Postfix) with ESMTPSA id 84AD550035B; Fri, 16 Sep 2016 10:07:40 +0200 (CEST) From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: Daniel Wagner , "Darrick J . Wong" , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Subject: [PATCH] hwmon: (adt7470) No need for additional synchronization on kthread_stop() Date: Fri, 16 Sep 2016 10:07:36 +0200 Message-Id: <1474013256-9996-1-git-send-email-wagi@monom.org> X-Mailer: git-send-email 2.7.4 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Wagner The kthread_stop() waits for the thread to exit. There is no need for an additional synchronization needed to join on the kthread. The completation was added by 89fac11cb3e7 ("adt7470: make automatic fan control really work"). Signed-off-by: Daniel Wagner Cc: Darrick J. Wong Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org --- drivers/hwmon/adt7470.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c index f5da39a..f5d618c 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c @@ -170,7 +170,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; }; @@ -271,7 +270,6 @@ static int adt7470_update_thread(void *p) msleep_interruptible(data->auto_update_interval); } - complete_all(&data->auto_update_stop); return 0; } @@ -1256,7 +1254,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)) { @@ -1271,7 +1268,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; }