Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2382960lqp; Sun, 24 Mar 2024 17:00:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU06jFzkFaUd57t0ErfHa0TNIxwcnOj6sNBITqbu8PcLwCEd2R8jwwTbgAexUucOhrrYE5xonBAmuNhSWMdpJiE59wULqthZOkGew0M6Q== X-Google-Smtp-Source: AGHT+IGS8fdq+zQa6LYL+5ugfxsOfjlRdWCAFlC1HBTWThxwB0mjnDCxPq8b4MRhtHVpwuB2dtKC X-Received: by 2002:a17:902:d3d1:b0:1e0:b677:293b with SMTP id w17-20020a170902d3d100b001e0b677293bmr2634819plb.29.1711324842377; Sun, 24 Mar 2024 17:00:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324842; cv=pass; d=google.com; s=arc-20160816; b=HZ6eEJm65debZsK+v3mv3JSirqRbjBIyBAjFP5kyeKFnHSQhHsAA9NEXAxw4WpBhGa q/bnHwC3lw9Ya8QIkJ2v3lyQTaM3BKmNjA7NT8jh5yZk5XRW8FBqu+txDLgt+zkXBEA1 2jqfjmf5IoZ6uqIMxD8pbX0GcYSilgKEoCUjFUrwUrZ2NureNM69Dl3W7o9iCAZeslqb BxUvGg6j0xMMk9SzGdrtW0l+dKAyZ8jWhG4z9pzVM09SFu7lMi/WEsaGxr6ATch8P9TC E/rAl7dmkuwwX1UKdqSi8QjnRM5WP0zUYUDnmpbUz6VStrQheJNeL2NZhcdOFtcZdhC+ m23w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Uq0tnH7LXaJCgpA6gA+ehLNXUkW8i25XusAf31BuIIw=; fh=JInu0N7VE/7kRg4WxrQszt9PU7GglAHYjEpXd05GPss=; b=jzYHJEWJwVxOkpDOUn5KEI7x3DHD4AsEoNMQ0mmIIa9b/3hHlAi4IFRTORoaXXwEA7 cjLV6t/sjWo86gj6n+fZ/HUicHIr9jpNy2DMZu3pq57mZLsHeXlpwvpAVD8tXERQLvg4 rA19fjohmm3JkR4pqRyQirhaMUSn6QWl94KfjhcmrzF9ztxAfgr50mBeHVF7akYdXcqY M1OjFvuLLLqW7ado2jev8evSprKwZ01O+ieSKEH6oZdBH0YanNnbCFPKcvfIi9MTzqSr eH6UZ4MddtAWwhjBz6eH/epu/qVzANOEwuga8EX+c+Efvz92fOaBewsSG8LIuRLj/LQf UZHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WjJpLL18; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f17-20020a170902ce9100b001d93f31a19bsi2063671plg.345.2024.03.24.17.00.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:00:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WjJpLL18; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113263-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BF534287BC2 for ; Sun, 24 Mar 2024 23:56:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D60B61892B8; Sun, 24 Mar 2024 22:41:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WjJpLL18" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00287189299; Sun, 24 Mar 2024 22:41:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320063; cv=none; b=bqA5IYFeIAsiksmF+6HRwWSB+TUpaLzuJ+aRTTHBG6JCc8sXAdJuPWBgZnXBCeRE6Mz/L/VAKB5ZWtNuj28B9vLcILOhelRjV9yPOQ9DLlBCiJsBscYEgY4uZo4jLFKhtJ2j3280w3H8LUBimYxPSdtVxP5nnlbcQRS3Fi9mgNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320063; c=relaxed/simple; bh=vwK9mT2SDzhQT/VK/uvqjMKc6ljiGp44qtXkgvlh3Js=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CjbYkcgW0TYhskTZmLd+vQMZ2u6QoAH3ifWyOA2zjn+0tpDoMG48aul+PGH+5L3I78GkZPjlkIQthrC+1quOkTwEq926/Q32hk821etnpu1d7QFqB1o/pxC/ucl8O+BHWPSXCRJ7QVXOnFYqOAKCoFmUPRILGM6IPK9B+AUsqDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WjJpLL18; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26EFBC43390; Sun, 24 Mar 2024 22:41:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320062; bh=vwK9mT2SDzhQT/VK/uvqjMKc6ljiGp44qtXkgvlh3Js=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WjJpLL18EQGnOpp86meQ1tarYk2LavsUV/j+FCiDGaREGeaoPcjQyJphCKNvGiGpJ vkonVi7rcgHp4WewDslNtUfEJtHtGl5kY5VXEkdwjCfF957Vdme32Xuzy+KtAuV/Yu t+obh3od9ZZsQ4ZI2f5Pis2b/OeXKzyG/J5pnrEwSyOHjazR72JaEwSHoVP+lteN0D l0H9gOoWzAf5Ofrs4ooHBr8VnTHQZWWoc17WiyfFynHDbSGglmc3oooQdGkBaKMVwH /OvpIc1uE+nPJDaHVbTeYtuqwdE96qcdiabORYjEzbzRE8Rl0rTyqDKlen3ImiW4ov FJ0Rc2+AZsdCg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Stein , Robert Foss , Sasha Levin Subject: [PATCH 6.8 372/715] media: tc358743: register v4l2 async device only after successful setup Date: Sun, 24 Mar 2024 18:29:11 -0400 Message-ID: <20240324223455.1342824-373-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Alexander Stein [ Upstream commit 87399f1ff92203d65f1febf5919429f4bb613a02 ] Ensure the device has been setup correctly before registering the v4l2 async device, thus allowing userspace to access. Signed-off-by: Alexander Stein Reviewed-by: Robert Foss Fixes: 4c5211a10039 ("[media] tc358743: register v4l2 asynchronous subdevice") Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20240110090111.458115-1-alexander.stein@ew.tq-group.com Signed-off-by: Sasha Levin --- drivers/media/i2c/tc358743.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 2785935da497b..558152575d102 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -2091,9 +2091,6 @@ static int tc358743_probe(struct i2c_client *client) state->mbus_fmt_code = MEDIA_BUS_FMT_RGB888_1X24; sd->dev = &client->dev; - err = v4l2_async_register_subdev(sd); - if (err < 0) - goto err_hdl; mutex_init(&state->confctl_mutex); @@ -2151,6 +2148,10 @@ static int tc358743_probe(struct i2c_client *client) if (err) goto err_work_queues; + err = v4l2_async_register_subdev(sd); + if (err < 0) + goto err_work_queues; + v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name, client->addr << 1, client->adapter->name); -- 2.43.0