Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2543128lqp; Mon, 25 Mar 2024 01:55:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVup8tQObPl2gRwauztBZ2bpG7GzvtuNgbEevu/2qCO8RRVNjSopTgXz9EXj5W1yXZkNDGKWAsviwb+2jCBnpFB60T0k9CizJwWHqujtw== X-Google-Smtp-Source: AGHT+IHYKOK+D+0w6YVUrsHqzxO/0HZAEUD2yNb7I9WkgA6poZgKQL8FXRcpUWeIy8vhsm8aYnZD X-Received: by 2002:a17:906:69c2:b0:a47:3cd5:b3f1 with SMTP id g2-20020a17090669c200b00a473cd5b3f1mr4687704ejs.35.1711356924330; Mon, 25 Mar 2024 01:55:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711356924; cv=pass; d=google.com; s=arc-20160816; b=cTaS1hFzkh+Gr5oxsA/O7QBBnYvWKHDEDT+99E6j1cm01H23T+lhkOFsAO5A5oV29t zyiFOix39CX3oQ/73Su+Ci+qOvHQAPOu/Kr4UrB8+fB/stLt3AkS4O4ip81C01uZzGhy gaoisOjMyRnbGlBupyI4Rs1z8LQHYcuNIQeB7qmNtC4K73s6tbvSzPl5wBcZpGllhHdA NUXETLaS32cnDFb8Kn/n2E9VVK1IMCFE1u7QUSb16oWRjsJmhUZ90ym9V26hABsgOLWp S6tR5m/s0JoNXcyMf+hjgWjY6eb40EjoHH2MVKyAYmLRA4az/YEVZjXrgi4b6zOzTVsC /Hdw== 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=bUUYs/JFNmFxQrNHXshKuW92Vj3LX1vBtEhNp/MK2yw=; fh=JInu0N7VE/7kRg4WxrQszt9PU7GglAHYjEpXd05GPss=; b=cQmISF+n1onEsru3nVIG8Si0Um2LXUQwdSEW8sr+pncLoAlzSB0qCNcvnyad4oRSM+ TCPhGiLL+w5H/hAWN4QFhGKRozsIatoNZf1eOlLSCefai700hSOrhotiQvDAiXCj1KB1 naHB/M71vBfB09bWj8qRJqwiyaQaFXua+y45L0cWVcmIEEWqm4ffgUmNjH83EckHiLoH HE92+ohwq1dFQMvdStlYkeoM1htHuB9JvQQBNytFNQquZ5MHJQw4hHBYX5GpkGoGx4yi VLF78QTNZ/zjjXYTYUlIhlfcIRxvaJsWOgsRzMW9+O92JPB2WWaM2gmrRNgFKbIG380o Lksw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I0K+fzYU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kn3-20020a170906aa4300b00a46fa632865si2404200ejb.990.2024.03.25.01.55.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 01:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I0K+fzYU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115946-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0E86A1F32096 for ; Mon, 25 Mar 2024 08:55:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE637390952; Mon, 25 Mar 2024 03:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I0K+fzYU" 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 CB4F022BC1A; Sun, 24 Mar 2024 23:16:14 +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=1711322174; cv=none; b=DroJlGl8I4Rz/Zyun/vmIRxgVSjtF+KwFXSsHtme2WjhjrM9X1qUdltonTh8sLXEBeZUVjVZ28rtC0O7bz1oZk0Yx6H/u7fcF3MgJh2WTtvHd46sqmfdPPkn4O/o8PW/cFzEDTmHlYg7VS+pVofBviw/hyGfjQvQNTL0xweUpVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322174; c=relaxed/simple; bh=zeB+hCTFAkXCutCoUYbjRdpphjBZfVd4YFr1luGBKC8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AKv8D3yVaas99QCss07I+I1QhXdN5XTaJHbFHq4UtTgLFSVS1b3d5LWPsNtsn37H96/r4074PK97OvLPJSIF+oo63kVe1C9861T8gPSPKvRV8e5dFEQTQRMggi0bff8owYC3HWR9Atf9Z5H4OcdCsZFwAwTaXjpo9i8CPcQuzOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I0K+fzYU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 195FFC43394; Sun, 24 Mar 2024 23:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322174; bh=zeB+hCTFAkXCutCoUYbjRdpphjBZfVd4YFr1luGBKC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0K+fzYU9gtiDuZotY5/BDRisThx2s8DsowGKQRiFV074yQxvMyznLMv+hTlT6tlW jJfN67bh+x9kjDCXmeAQdTEo0StOZKnVtattMPCCvvEOrvQ2e8z7+2R1jQwqaqbSuZ vAwom7b7QVzRtBV+WmDk4zbHCj8pi3xfZ4N4aoeNaIeZS+D2i5ozBOT5gmH6BySFCS 8dOki0s5X5mKOsC5BMl5wJEnzl7LOzVTOj7Qfjf/XoQPAwQnxy72QF9oMBW1s6uQC2 6zhbgzfwV1yatIMck2GpfftWz3ho9ZcbY8VjCrKmOZlUBvyHYCD797wG/8puIwPhlr LnsHJ/HC+zRkA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Stein , Robert Foss , Sasha Levin Subject: [PATCH 6.1 253/451] media: tc358743: register v4l2 async device only after successful setup Date: Sun, 24 Mar 2024 19:08:49 -0400 Message-ID: <20240324231207.1351418-254-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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 200841c1f5cf0..68628ccecd161 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -2094,9 +2094,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); @@ -2154,6 +2151,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