Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp427714pxb; Thu, 21 Oct 2021 02:18:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkW6IBHCb3/a88OrgxnZzKuslAxNaXDYSG46/OVfx+O9e8voLexQwTeMuI1T/i39Rjh5Zx X-Received: by 2002:a17:907:90d7:: with SMTP id gk23mr300783ejb.300.1634807920341; Thu, 21 Oct 2021 02:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634807920; cv=none; d=google.com; s=arc-20160816; b=x8xcJW7kbRynad2X976Xkk+VbAcMQOaYVA5hj6x/ya3Eax5G43yDaegDEi7CzLnXE2 cPFH7JjnLwMyNhsis5+/1wVlbBsSfkLEGA37Z8OAWLuI0AGRqbEkuKDSgsbb/V0GUPNF Z2emUe6VBY2kafZH8EetGoPDWzDPWAt/I2YUT1PrfcsTQXEkBX9BD6n5US98Ve/8DiGo 9Ni0QZ6NRuJzNg9ku8xHPupaRrSHJGXPMBBzAoYlKW5dJNYOa38XV/Pmuss0t21/+pu0 P0OTveEo8JhdGgFhkGxeRQnaJ+/rNIkCz35eeunapzJI/d1D3J9aa5r23iQuRaN+RHG1 P26g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=i+SnuONOegICjklYg94K84m8Df82oK2VZ/A89aKXHVc=; b=JioXbQ6I/PRscdWN7XNi5NA7PP6VmPan+MGtOlxzQkymY25LPw3MYQR9HIzEmo0sBu JnoXA+Bx9Xa3REKELmRioa7HNn+hsGQvms5Bs2ZydLEPMTD57mLKsBGjWbAmLIfqExVN 6pblcMTl66SdQukxQbncgWwszYJAXzTwACq/8LALjtRcVTFjlTlwFCRsZQ3HQJeG0zYh iC5a332iJnTze2bSPoKhITL3gnBft2ie0LGWEWSR1eKbd+aRNEaprg2gKgQUSWSnEIwG 0GGFF5wYoSEIsQ6pz5VWjmkc8Nq9eLT9ytvcEzrbLkvq9/XtT51taAL2Tt9BKAfYZ069 vHxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=P6XdrXyU; 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 ho39si8529756ejc.1.2021.10.21.02.18.15; Thu, 21 Oct 2021 02:18:40 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=P6XdrXyU; 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 S231509AbhJUJSL (ORCPT + 99 others); Thu, 21 Oct 2021 05:18:11 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:53134 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231332AbhJUJSK (ORCPT ); Thu, 21 Oct 2021 05:18:10 -0400 Received: from pendragon.ideasonboard.com (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7ADAF2BA; Thu, 21 Oct 2021 11:15:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1634807753; bh=T/6+QgMuTTHfslB/SXTR1IyVTkqXdr+Skb2LtMWzDTI=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=P6XdrXyUKzvqFCUwcM8LXHPj2X6/TuHR8ytYg9gTdM6SsHaJXFV8+gdEe5J8J+Dks gsSPOyTMUnvqVAtQB40nfG8S2zU/cXVUOh1Bz6wwNbYNq6j2eaqiK+kAdc6wd3bpfO qdKWuTzYEA4mOJt0OUiRQaPA8V/HcoaBR5NnZwIQ= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20211021084143.2077-1-caihuoqing@baidu.com> References: <20211021084143.2077-1-caihuoqing@baidu.com> Subject: Re: [PATCH] media: gspca: Make use of the helper macro kthread_run() From: Kieran Bingham Cc: Erik Andren , Hans Verkuil , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org To: caihuoqing@baidu.com Date: Thu, 21 Oct 2021 10:15:50 +0100 Message-ID: <163480775070.2663858.11003042338981812432@Monstersaurus> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Cai, Quoting Cai Huoqing (2021-10-21 09:41:42) > Repalce kthread_create/wake_up_process() with kthread_run() > to simplify the code. >=20 > Signed-off-by: Cai Huoqing kthread_run does look appropriate here, and is simpler. Reviewed-by: Kieran Bingham > --- > drivers/media/usb/gspca/m5602/m5602_s5k83a.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c b/drivers/media= /usb/gspca/m5602/m5602_s5k83a.c > index bc4008d5d116..4504d615b1e4 100644 > --- a/drivers/media/usb/gspca/m5602/m5602_s5k83a.c > +++ b/drivers/media/usb/gspca/m5602/m5602_s5k83a.c > @@ -339,14 +339,13 @@ int s5k83a_start(struct sd *sd) > /* Create another thread, polling the GPIO ports of the camera to= check > if it got rotated. This is how the windows driver does it so w= e have > to assume that there is no better way of accomplishing this */ > - sd->rotation_thread =3D kthread_create(rotation_thread_function, > - sd, "rotation thread"); > + sd->rotation_thread =3D kthread_run(rotation_thread_function, > + sd, "rotation thread"); > if (IS_ERR(sd->rotation_thread)) { > err =3D PTR_ERR(sd->rotation_thread); > sd->rotation_thread =3D NULL; > return err; > } > - wake_up_process(sd->rotation_thread); > =20 > /* Preinit the sensor */ > for (i =3D 0; i < ARRAY_SIZE(start_s5k83a) && !err; i++) { > --=20 > 2.25.1 >