Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp586921pxb; Thu, 21 Oct 2021 05:45:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkEd8XImuTxrmEE2arOyFwG/hJqjdXANmCw8uccpra5ryYE6k0027m3wHa6G5NsRr6VZLP X-Received: by 2002:a17:907:334f:: with SMTP id yr15mr7427334ejb.8.1634820346157; Thu, 21 Oct 2021 05:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634820346; cv=none; d=google.com; s=arc-20160816; b=zKN50sUEQZbdKZXvspf0X8H1USEJgZZbpnI7db4dm8tvmn9djU0F1WxkYnAj4SFxUn Dqke8UAoTvincPlUjKlUmf+drPWcrKqD0s1ND7ZpAXVsDSW/gvbvhFilBStUNuhUja2O YJ0zaDxTem1Gqx5U4cz7MkjSrGjoi8obwVBCAbg0ZzKthZO+KNOgAhGtBKLBKKHi1hpu C8MuWobYKzYMGLHbaQMCaGLaNpwNWvRo1cHwdntdnVeJj54lS3T6h8iykJ8qH7pfKpo+ yweFt5lheQx0GApWSBKrLUyMSL3178S2A8GP3eGnKDlmq5mJAuI2XcKB/L9ghEaAC4kh xdZA== 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=6LCVcfN9hECFw6KJeacNznMaylyiE4a8+txzjIkgFFE=; b=V1xeo523kPNgxpExDTy7mLk4Cki8XtwwghLbxFKDzeyC+RYP8UEbbV5MwjPUKgT4iO lNQO/PsaqV+mZGQGLRnUprevLBUI2Ok4MQTrKjQon7BlV7kVoyxZ+lqI0QChDy4TeFcm 7e5L49OtS1Btpz+oXbODKAnnopYvU/+dwm8Yz9JNozyTULLCyn0BXhG9sU6u0LY87rsp Jt4cSuLvZut1RUQYCL2S1hkgPoFn++MDyWySkYCyh2hoHXW3T0/Enpd/ZmNqtiX7Qmjg qj4AfkeozLaQtRpBABJnuY5Bt3prh8Mbe21QIZEgmyx8crWro8ek8Bz9A31B0WM58v/J eIwA== 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 f14si6192633edc.450.2021.10.21.05.45.21; Thu, 21 Oct 2021 05:45:46 -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 S230372AbhJUMp2 (ORCPT + 99 others); Thu, 21 Oct 2021 08:45:28 -0400 Received: from mx24.baidu.com ([111.206.215.185]:57666 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230260AbhJUMpW (ORCPT ); Thu, 21 Oct 2021 08:45:22 -0400 Received: from BJHW-Mail-Ex12.internal.baidu.com (unknown [10.127.64.35]) by Forcepoint Email with ESMTPS id 3E222FEFF96EA002A8F3; Thu, 21 Oct 2021 20:43:05 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex12.internal.baidu.com (10.127.64.35) 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 20:43:05 +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 20:43:04 +0800 From: Cai Huoqing To: CC: Cai Huoqing , Jonathan Cameron , , Subject: [PATCH v2 1/2] iio: adc: ina2xx: Make use of the helper macro kthread_run() Date: Thu, 21 Oct 2021 20:42:53 +0800 Message-ID: <20211021124254.3247-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-Ex22.internal.baidu.com (172.31.51.16) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex12_2021-10-21 20:43:05:286 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. Reviewed-by: Lars-Peter Clausen Signed-off-by: Cai Huoqing --- v1->v2: Sort with [2/2] patch as a series. 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