Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1586603pxb; Thu, 4 Nov 2021 05:08:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3zOjeqdy5FsLs0wHT/jTn1R5L/eVYO8da7g5NSYHyFrQBZdtrde1mHIgAsWfvWLAXc8M0 X-Received: by 2002:a17:907:1c85:: with SMTP id nb5mr28354209ejc.502.1636027714719; Thu, 04 Nov 2021 05:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636027714; cv=none; d=google.com; s=arc-20160816; b=S9jmjNZNIHlP0oiy5Y0G0ZMs64SgvWsdonWwjb95/i/PwzxSXXB1ywH98fRDgcKbj/ gpSJlcTWPnUeYO2qELatouv6U2K58Y9vGDb9uoFdAJq4gLvvB+Fx/KKBpLmTLeIqMrLK q8zqnY5zZjaTPfut+cjTKZ1dw02K80h4CmIq//J32YjU4TRM63axQVhYjjoiKp5ory2B gRK4o/t4hXc1E6/UWSg2q7tRWVG/pN8D+ibWphPb0KiQpLejpiZ7urNhCJ2oSPZ9w6OY T3f2kSm2i2s+2CBrryBuNI9Fw/J+whsum4UbnBklquTdW61xm8z4I/3KgxCbtq210gNH S9Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=mSL2vjTr9vKc4BiVRa3c19qry0YXI+LZbSgwgnkSED8=; b=yW0NipA5yIByBmXdnEaw5UQY42ZtvMBDoEXB+oC6ayR6MmdHoqwgCYgj6s7jgmPxQ1 igTRj0mn5FeqQ//f3PW4eK+mHHqd7G171J3z4oIOHfqcf+q5lAZoxMFxdhKO3+jROsWn fHVavBCsl41nVFN8trsYIj01ykdbkDfLdTO/rVkSHd0QrxdmjkacqfocM9k1kMb0czL8 Xhp/eufB7me7pnNEHpZ+RRKkQNf6RuH+jK9KD4HHFZ901ve/rc3mikXc8X9RsrN4OWvj lTa3qB7kmBqtFRizBfcbWKta25yyB0kGFc+gq5hKNnT7geeLNO6qQrF9LmmrtVKpGx8v AJig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=iJCEOOTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si7851724ejj.400.2021.11.04.05.08.09; Thu, 04 Nov 2021 05:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=iJCEOOTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbhKDMIq (ORCPT + 99 others); Thu, 4 Nov 2021 08:08:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:37090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbhKDMIi (ORCPT ); Thu, 4 Nov 2021 08:08:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8ACEE6120E; Thu, 4 Nov 2021 12:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636027560; bh=HybiI7UdlSZcnbdy55jEnHO7M01Yy9wdGqRy2VCwnT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJCEOOTcX38JqGf3XOeX1UrAV/yixYarKvHsFQRafL9F0l0ywYhJUDmUSIcw/0joR 9cAvEhx3nyP0QTNMwgFp8R+lsaKSG5XQymBIWQxXb9QXapAisJShYnrLBXpzSa2k40 zP41OnC13PK9quZORoX1ceOYm0hOAREeUDMPY1v4WMwsh0Is8mmg3LHbKEnp9QbvtU csevUGneEVOG50CWZYVSwPxwgEFM9rSMaNuPgOqeEbq0T7Kt1ZJWZegL51CUOJh/91 66ITVEbhiFat5Qs7Fnybayd2QJBSDUhbgibt7p1hfBREYcNVuuxx93uTbL2KNGzhvr 6a9P8gGBPo78w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mibVG-005nHq-7G; Thu, 04 Nov 2021 12:05:58 +0000 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Arnd Bergmann , Dan Carpenter , Greg Kroah-Hartman , Ingo Molnar , Mauro Carvalho Chehab , Peter Zijlstra , Sakari Ailus , Tsuchiya Yuto , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 5/7] media: atomisp: move atomisp_g_fmt_cap() Date: Thu, 4 Nov 2021 12:05:54 +0000 Message-Id: <75e35d0ea4b6ee7f47bbed61f2eb258a07bcd01f.1636026959.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org move atomisp_g_fmt_cap() for it to be after try_fmt, as we'll re-use try_fmt there. No functional changes. Signed-off-by: Mauro Carvalho Chehab --- To mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 0/7] at: https://lore.kernel.org/all/cover.1636026959.git.mchehab+huawei@kernel.org/ .../staging/media/atomisp/pci/atomisp_ioctl.c | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index 30483a84ed80..84ff97dabbed 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -833,6 +833,34 @@ static int atomisp_enum_fmt_cap(struct file *file, void *fh, return -EINVAL; } +static int atomisp_g_fmt_file(struct file *file, void *fh, + struct v4l2_format *f) +{ + struct video_device *vdev = video_devdata(file); + struct atomisp_device *isp = video_get_drvdata(vdev); + struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev); + + rt_mutex_lock(&isp->mutex); + f->fmt.pix = pipe->pix; + rt_mutex_unlock(&isp->mutex); + + return 0; +} + +/* This function looks up the closest available resolution. */ +static int atomisp_try_fmt_cap(struct file *file, void *fh, + struct v4l2_format *f) +{ + struct video_device *vdev = video_devdata(file); + struct atomisp_device *isp = video_get_drvdata(vdev); + int ret; + + rt_mutex_lock(&isp->mutex); + ret = atomisp_try_fmt(vdev, &f->fmt.pix, NULL); + rt_mutex_unlock(&isp->mutex); + return ret; +} + static int atomisp_g_fmt_cap(struct file *file, void *fh, struct v4l2_format *f) { @@ -907,34 +935,6 @@ static int atomisp_g_fmt_cap(struct file *file, void *fh, return 0; } -static int atomisp_g_fmt_file(struct file *file, void *fh, - struct v4l2_format *f) -{ - struct video_device *vdev = video_devdata(file); - struct atomisp_device *isp = video_get_drvdata(vdev); - struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev); - - rt_mutex_lock(&isp->mutex); - f->fmt.pix = pipe->pix; - rt_mutex_unlock(&isp->mutex); - - return 0; -} - -/* This function looks up the closest available resolution. */ -static int atomisp_try_fmt_cap(struct file *file, void *fh, - struct v4l2_format *f) -{ - struct video_device *vdev = video_devdata(file); - struct atomisp_device *isp = video_get_drvdata(vdev); - int ret; - - rt_mutex_lock(&isp->mutex); - ret = atomisp_try_fmt(vdev, &f->fmt.pix, NULL); - rt_mutex_unlock(&isp->mutex); - return ret; -} - static int atomisp_s_fmt_cap(struct file *file, void *fh, struct v4l2_format *f) { -- 2.31.1