Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp668616rwe; Fri, 26 Aug 2022 11:59:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR6y2GU7kfKv+XFvKPwvmxXwNXNVOZqjIBeg4rXeL6AFTdUD61jDJiBv6sPr4u1u7dFEhy5z X-Received: by 2002:a17:902:b789:b0:173:e22:6aa5 with SMTP id e9-20020a170902b78900b001730e226aa5mr4796940pls.147.1661540372943; Fri, 26 Aug 2022 11:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661540372; cv=none; d=google.com; s=arc-20160816; b=ub9TsGvGXfRgq250xKrPOuBXo+dYqdAhjOguHRt1SYUlvMZkCy2IJVy2o2zqHPf4Dr SCyWIpchnKBDskGZf49ncsP+nbYwI/DWzcBKIUZBTlB1cgDTII+5IWrccRhnJsrA5ZX1 p2wY7GhKPrzc7ChRqvsUJcgPYPxslRdrwDlYIchSCryCsg7rF/3zv0656PxbtDZI18rH YPoDqq8fotWpZU/3xk+bnIxCVsDTxb3IXo4A+P0qr4a6hk3Mhg1+48Suu3WoICddv4TB 61xBDWPZJUADbxcJaEo2t+FyJIf4RdQ0A4+ysN7IL5Xr60pLJi+Q6X2dg+FJtfKzO5jJ rSHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YHb1VQjxCo0GfpA5hhR9r6UqiGeualuinCN/R5B/srI=; b=LEVN9mRMU8D82vBEqXWWr8qTJcvMz7TRVDNtAvWmC25B+HVKeIT0+O8FiJDTe0AC0R pWG0TUOdnAqB8NjnLDf55qfaAk68VqxE6Gj5rAsFcYVT/maPPkbkd4XvXQSvJX+iQDKC R1gHb71eNELSWfkW9h8N5F5FYddhTEBm7BqAE5x7iHFMS1RT+rpYMfjphba347m7rIrz F10VRf9ObHR05Fqjp4etd5o2dljEmCtNZC/nmXBDqa5PUTrkevT0fpW0XDp/3wP12Ws/ MVbiaUq/we4VDV1jNukOQqJxcyNlTkE8VXveYxRdikn0D+m0g9g/0nRGbPTfbyM57pJV v8qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OPTzDwUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r134-20020a632b8c000000b0041cb4fd2e4esi2241720pgr.793.2022.08.26.11.59.20; Fri, 26 Aug 2022 11:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OPTzDwUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345007AbiHZSgc (ORCPT + 99 others); Fri, 26 Aug 2022 14:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344757AbiHZSeb (ORCPT ); Fri, 26 Aug 2022 14:34:31 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50DA4E58B9; Fri, 26 Aug 2022 11:33:46 -0700 (PDT) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id BB581FF80A; Fri, 26 Aug 2022 18:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1661538825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YHb1VQjxCo0GfpA5hhR9r6UqiGeualuinCN/R5B/srI=; b=OPTzDwUo/2Q3fjtpxiDIwIOf27MQ+sshl6UJphmuo6ahm14LFVvmwNJ/TQr4WdWv/Wj9Jp /GuZ1+opq6D/R1VWQ0Py6JD2ofV9wXWU+PMpITDQvK0rEpjrRKOoKh1sB2SzfinESNZ48L 7R37qZmgKkNCnvWR9l3o0IwjtXn3kbZ45mom8rLMQtRYeWdXnP/lItTiBYtNrlZA4qgXrI EdXYvg9oMS/58Qwz0GRxHjZloZM07hBTC4WndZVx+leh7i3WsaZ4v5GVo3lcuuI5vMRrT4 5AQ+0nGYy2TttWvmYHs2Ob3JKQK30NCRqgho5qY+DxzUQ047neZCFPyEz6ri6Q== From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Laurent Pinchart , Maxime Ripard , Thomas Petazzoni Subject: [PATCH v6 35/43] media: sun6i-csi: Get bridge subdev directly in capture stream ops Date: Fri, 26 Aug 2022 20:32:32 +0200 Message-Id: <20220826183240.604834-36-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220826183240.604834-1-paul.kocialkowski@bootlin.com> References: <20220826183240.604834-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The remote subdev connected to the capture video device is always our bridge, so get the bridge subdev directly instead of using a dedicated helper (which is removed by this commit). Signed-off-by: Paul Kocialkowski Acked-by: Jernej Skrabec --- .../sunxi/sun6i-csi/sun6i_csi_capture.c | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c index f2a30797473a..b91b6ad44ba1 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c @@ -42,22 +42,6 @@ void sun6i_csi_capture_format(struct sun6i_csi_device *csi_dev, *field = csi_dev->capture.format.fmt.pix.field; } -static struct v4l2_subdev * -sun6i_csi_capture_remote_subdev(struct sun6i_csi_capture *capture, u32 *pad) -{ - struct media_pad *remote; - - remote = media_pad_remote_pad_first(&video->pad); - - if (!remote || !is_media_entity_v4l2_subdev(remote->entity)) - return NULL; - - if (pad) - *pad = remote->index; - - return media_entity_to_v4l2_subdev(remote->entity); -} - /* Format */ static const struct sun6i_csi_capture_format sun6i_csi_capture_formats[] = { @@ -822,8 +806,8 @@ static int sun6i_csi_capture_start_streaming(struct vb2_queue *queue, struct sun6i_csi_capture *capture = &csi_dev->capture; struct sun6i_csi_capture_state *state = &capture->state; struct video_device *video_dev = &capture->video_dev; + struct v4l2_subdev *subdev = &csi_dev->bridge.subdev; struct device *dev = csi_dev->dev; - struct v4l2_subdev *subdev; int ret; state->sequence = 0; @@ -832,12 +816,6 @@ static int sun6i_csi_capture_start_streaming(struct vb2_queue *queue, if (ret < 0) goto error_state; - subdev = sun6i_csi_capture_remote_subdev(capture, NULL); - if (!subdev) { - ret = -EINVAL; - goto error_media_pipeline; - } - /* PM */ ret = pm_runtime_resume_and_get(dev); @@ -886,12 +864,10 @@ static void sun6i_csi_capture_stop_streaming(struct vb2_queue *queue) { struct sun6i_csi_device *csi_dev = vb2_get_drv_priv(queue); struct sun6i_csi_capture *capture = &csi_dev->capture; + struct v4l2_subdev *subdev = &csi_dev->bridge.subdev; struct device *dev = csi_dev->dev; - struct v4l2_subdev *subdev; - subdev = sun6i_csi_capture_remote_subdev(capture, NULL); - if (subdev) - v4l2_subdev_call(subdev, video, s_stream, 0); + v4l2_subdev_call(subdev, video, s_stream, 0); sun6i_csi_capture_disable(csi_dev); sun6i_csi_capture_irq_disable(csi_dev); -- 2.37.1