Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2579147lqp; Mon, 25 Mar 2024 03:21:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrihBBxjPST9A99wj4rQ4hDdeToFXs5Lzn64z7TLtXHL8+9zeK9orEuxJ1bvZSXVZcUmC6wYMyLAuPa4CAG1vzOoMMFwzpi2mrsNOuJg== X-Google-Smtp-Source: AGHT+IEZcA/vnAT926+MQ9T8QXXVz+laGhx0cSvVkY7PaV/eY1GH/MadHBXr4WnqKwnOMR250Ru2 X-Received: by 2002:a17:906:7d51:b0:a45:f352:73b0 with SMTP id l17-20020a1709067d5100b00a45f35273b0mr4751070ejp.65.1711362091685; Mon, 25 Mar 2024 03:21:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711362091; cv=pass; d=google.com; s=arc-20160816; b=INy8iF9EWYcbnruhOZkaqHDfsAnJFKWjZBaZYUuESo7yA9zic/4zaWo7MW/9Mlh3ri eMsBOglSnazcDzbCQFqLOZH5h5xSjizNCDcmPo+kWz6a4yfosarNA89llmdOeTTcCXoy doM+FX9nSJBS0q2N/X8NVXUf9bZNu7BGGGOQ4Qp+w4FHacjYon/Mm+t0y9X7TG9Vbz5s ACMBbgLbrFOpvycX1KyEQuQssAGSokxsWSLTykEFndZn2biBn+p0srvt7U0rUnU9UajK IPLeL6xwKEvyc6UuI/WqP/MFrVSFzNjxPviJ9BtF1Q7lgXtL72KU6n3l9ZiSHVo6MWMx 5w9Q== 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=Q369nKDl9s6vhp08jypyep/dMl/ivzNoaxuD+fo0dDY=; fh=JInu0N7VE/7kRg4WxrQszt9PU7GglAHYjEpXd05GPss=; b=FJV+piSVMBoCcgVqT22pCRfWW4d9xJ+QVKnMjw9NuVUK/67S64qoYUofhrrYG4yftl 7mTiqPnpCYPGEDUDmy4TgwqJuXlZNRRoJn+gzLyWn6W0Gi00RHEPjPWZU5fENhkIZsqE ekVhkstRSUzDbha1TxyfI5rbMvZiQzNukrt7HbhY+4UgNkFw04ONek/9W6wxzxtDaoKv XePJTkbpDhB8nwQFeIBD+8OCY1DzOARUexYx9p5w3qMzF/Wj/IqGj6kYiRXVRamrc9QS vqndc+ivtkjYB4idjQo0+3pxc4+merRVvNMLeYtnDyAiNpo6CTnbP0KudqlLh5HAHjTc /Uiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=REae+OKe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116168-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 di21-20020a170906731500b00a474d67a80asi1604319ejc.705.2024.03.25.03.21.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:21:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116168-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=REae+OKe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116168-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 6AA0D1F36E5C for ; Mon, 25 Mar 2024 10:21:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D36612904CB; Mon, 25 Mar 2024 03:32:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="REae+OKe" 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 B89B517BB0D; Sun, 24 Mar 2024 23:42:29 +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=1711323749; cv=none; b=rRjXX/GJED5AMTjscmVgugpQkXtd+Cl44/x0ykHYZ3ADnKwiWkxPoO9EuhwFbF0OwgHmKyjQE3Hm50XpavaaUXyoyxlltcjTRCFrRbF6K0OeQUp9yqFAW3FD19P6LDOBwvJjqxcauX9nfoeKtBK2UwF0PScM6RpqDBQ5Y1Z7atw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323749; c=relaxed/simple; bh=UDJCJA68KZXVJvBT+zW2Mxy5ai0v5gJxejglB49KUjQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f3wI62vd9meQ7XKDhgdfm5J8PYcHOw0AYF30m32wIrADOuKsxC50KcTs5w8ZXD4F69g/h3Dso1AxlDtklM91uIx3voHfxe2Dwug02PMSg00pLnX4H+zS/SqQ0+IxwEMZ0XjWbhnWRU6wN3I5/HrYxr5loZZaW/nrFi/RvXHGdFM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=REae+OKe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2165C433C7; Sun, 24 Mar 2024 23:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323749; bh=UDJCJA68KZXVJvBT+zW2Mxy5ai0v5gJxejglB49KUjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=REae+OKeWNCqD4cyjqR12EtSnVig8PP+0yGMQasvhlJHwKmEGDnAof3Xo3X+0SshU 1rYNBXgFoxFg8uD0IUx9cwdOk1ej5Qm3vazshYdAgrmaGcTNMxDVm+QpmxTazXj8TV V6VE64f3yRv28GUWPY4l7gO54ypmWyELWYZ015TR1lmFBqc5GuVX6p2nfusSpz0Vt7 +rHl4tRUZymUIq+vLKsRHGZYGzOqXT9K/1qDgp3JFU6XQUsKARBm/J+z4u42Yz3rXH dnPf097u8Em/eNhhRQh2giwzv60+s3NYBtr8Z1/meWqOXTGBq4mHQv5qC4FZoN8a+D nJtJ/dlBe+6iA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Stein , Robert Foss , Sasha Levin Subject: [PATCH 5.10 124/238] media: tc358743: register v4l2 async device only after successful setup Date: Sun, 24 Mar 2024 19:38:32 -0400 Message-ID: <20240324234027.1354210-125-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-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 f21da11caf224..8bcb4b354c895 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -2108,9 +2108,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); @@ -2168,6 +2165,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