Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp403099pxb; Thu, 21 Oct 2021 01:41:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbpCLCjfCTvm4PowWnR7L2aTmAB10nPJ5Ahv0LesHo26vO5SFsWfUIGz5BM2yeSMpe9sdd X-Received: by 2002:a62:7656:0:b0:44c:591b:5a42 with SMTP id r83-20020a627656000000b0044c591b5a42mr4157633pfc.57.1634805714130; Thu, 21 Oct 2021 01:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634805714; cv=none; d=google.com; s=arc-20160816; b=d9jzp+jnlALC2/CfFOrX5P4DG+/rcUBXTvjNmRjl95r6fFk7crbAcAwZeW2zFajf2s VdcUP6/hPusUg+bziOwE9NpsBmd+APzcYI0MfQMObE2PQjZdhnT0jaAws4oQrmqUFcHo Akc0xX9MRYDkYiIw5ZynNNk7ISsjBiZxGnfG3LeX4rELeNp897k4dbZKZNcrXJHgPvgt pvjoT5HEYaM7Qtu6j2q1iC+GeVFI6j8BParsjDMuiEpwff5UmpoqX7VfzHcJrW52S5iF 5qdK56IqUWRIHTQURyPzA8cj84i9dk9PP+QLIEu53eo74mNlC6c9teJlMhpW3mIWo8Nb va9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=+Pebo6rKhxTK0z7Ys7HzTrBW4n/yLFmMFj9rhKdQV1I=; b=hnrlgd30aB7bflHa2UD72Ho+kgLTjNvS0JQf8fmovJYqMDs7jR/7sWZpkJNNE92fYX XI4NleTSkx0P7o0Y028ziijsy02tRGm+UYaL87REX7wpqCsrINo2Yt5+VCqzE1l3QaAF cWJt2xQi2UclDITxoItS6YRIck6UnNvGRSppZvavxdSs2Q1PZyRZrhigjKIynp0x5tGz FTuE4GWsdti48DjRsc/KjyUdXltLA3sWb5s76Y5rSIUFhvfmkd3ZqDGskERN49NJYWNl Ew2KLw1FFleqtv+RKKUoZm9Xu9KmGHC2TSwpZTfR8s9t529YL0xz8PWyNa9oofEun9nH OElw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si9728554pgu.99.2021.10.21.01.41.41; Thu, 21 Oct 2021 01:41:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231499AbhJUIli (ORCPT + 99 others); Thu, 21 Oct 2021 04:41:38 -0400 Received: from mx24.baidu.com ([111.206.215.185]:43338 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231315AbhJUIlh (ORCPT ); Thu, 21 Oct 2021 04:41:37 -0400 Received: from BC-Mail-Ex16.internal.baidu.com (unknown [172.31.51.56]) by Forcepoint Email with ESMTPS id CFAB9BD4B00325289DF9; Thu, 21 Oct 2021 16:39:19 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex16.internal.baidu.com (172.31.51.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Thu, 21 Oct 2021 16:39:19 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 16:39:19 +0800 From: Cai Huoqing To: CC: Jonathan Cameron , Lars-Peter Clausen , , Subject: [PATCH] iio: adc: ina2xx: Make use of the helper macro kthread_run() Date: Thu, 21 Oct 2021 16:39:17 +0800 Message-ID: <20211021083917.2024-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-EX02.internal.baidu.com (172.31.51.42) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing --- drivers/iio/adc/ina2xx-adc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index a4b2ff9e0dd5..360d7a00f60d 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -842,15 +842,14 @@ static int ina2xx_buffer_enable(struct iio_dev *indio_dev) dev_dbg(&indio_dev->dev, "Async readout mode: %d\n", chip->allow_async_readout); - task = kthread_create(ina2xx_capture_thread, (void *)indio_dev, - "%s:%d-%uus", indio_dev->name, - iio_device_id(indio_dev), - sampling_us); + task = kthread_run(ina2xx_capture_thread, (void *)indio_dev, + "%s:%d-%uus", indio_dev->name, + iio_device_id(indio_dev), + sampling_us); if (IS_ERR(task)) return PTR_ERR(task); get_task_struct(task); - wake_up_process(task); chip->task = task; return 0; -- 2.25.1