From patchwork Thu Apr 21 23:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 564657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F2C8C433FE for ; Thu, 21 Apr 2022 23:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442695AbiDUXqC (ORCPT ); Thu, 21 Apr 2022 19:46:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442686AbiDUXqA (ORCPT ); Thu, 21 Apr 2022 19:46:00 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37FBB38DAF for ; Thu, 21 Apr 2022 16:43:09 -0700 (PDT) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 22132102E; Fri, 22 Apr 2022 01:42:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1650584576; bh=X2XxoSDdVIy1hZmfB424smfLydORETeNUsbI6Dt/2Js=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDRZvMCgAzRmdqzIwW9Jgbq6AgFrvwZzrzYltOsQrZ5uxjjTeboYc20sKEe7+USgX vu1f1qvaq7Aw4led0a0kFUuiNC7QJuHLVDVRGBVTl2lcDE5dAHae2CLCeJHDkit73k WVNHBNWaCXXEiDlTfwb34pdfIbFetKogBzTA7SyM= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Dafna Hirschfeld , Heiko Stuebner , Paul Elder , Tomasz Figa , linux-rockchip@lists.infradead.org Subject: [PATCH v4 19/21] media: rkisp1: capture: Bypass the main device for handling querycap Date: Fri, 22 Apr 2022 02:42:38 +0300 Message-Id: <20220421234240.1694-20-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220421234240.1694-1-laurent.pinchart@ideasonboard.com> References: <20220421234240.1694-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Paul Elder When handling querycap, the capture node would access the main rkisp1 device unnecessarily. Get the information from the most direct source. Signed-off-by: Paul Elder Reviewed-by: Dafna Hirschfeld Reviewed-by: Ricardo Ribalda --- drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c index a7cf672457cd..94819e6c23e2 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c @@ -1248,11 +1248,8 @@ static int rkisp1_g_fmt_vid_cap_mplane(struct file *file, void *fh, static int rkisp1_querycap(struct file *file, void *priv, struct v4l2_capability *cap) { - struct rkisp1_capture *cap_dev = video_drvdata(file); - struct rkisp1_device *rkisp1 = cap_dev->rkisp1; - - strscpy(cap->driver, rkisp1->dev->driver->name, sizeof(cap->driver)); - strscpy(cap->card, rkisp1->dev->driver->name, sizeof(cap->card)); + strscpy(cap->driver, RKISP1_DRIVER_NAME, sizeof(cap->driver)); + strscpy(cap->card, RKISP1_DRIVER_NAME, sizeof(cap->card)); strscpy(cap->bus_info, RKISP1_BUS_INFO, sizeof(cap->bus_info)); return 0;