From patchwork Wed Aug 30 04:53:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13369959 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 25907C6FA8F for ; Wed, 30 Aug 2023 04:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242077AbjH3Exq (ORCPT ); Wed, 30 Aug 2023 00:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242042AbjH3Exh (ORCPT ); Wed, 30 Aug 2023 00:53:37 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 814A1CCF; Tue, 29 Aug 2023 21:53:34 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.251.226.104]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B0B0DE2; Wed, 30 Aug 2023 06:52:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1693371131; bh=towQ2H8NltBDF1fWdRSieCZdXaLAdwWxSAFfmDmWsPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XN1KbXqnzUAvU7z3lR47hd0EFM2KRoPBsQnwa96lsSkVH4ZSMmyHLsBLKxnxFQZNU ifIK+qLkQ/Q88iHd+03H/r7ovnfua0BESSj+sPkxSxAf4I8W9gd44p9DoUM84JZe8x gCKykoLh1zLoHuoowanGqDXaDADNbpWXqt/IB2eI= From: Umang Jain To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Riesch , Sakari Ailus , Mauro Carvalho Chehab , Ricardo Ribalda , Laurent Pinchart , Kieran Bingham , Umang Jain Subject: [PATCH 1/2] media: i2c: imx214: Use v4l2_subdev_get_fmt() Date: Wed, 30 Aug 2023 10:23:22 +0530 Message-Id: <20230830045323.71768-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230830045323.71768-1-umang.jain@ideasonboard.com> References: <20230830045323.71768-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx214 driver uses the subdev active state, there's no need to implement the .get_fmt() operation manually. Use the v4l2_subdev_get_fmt() helper instead. Signed-off-by: Umang Jain --- drivers/media/i2c/imx214.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c index 2f9c8582f940..d8bdc52f552a 100644 --- a/drivers/media/i2c/imx214.c +++ b/drivers/media/i2c/imx214.c @@ -548,21 +548,6 @@ __imx214_get_pad_format(struct imx214 *imx214, } } -static int imx214_get_format(struct v4l2_subdev *sd, - struct v4l2_subdev_state *sd_state, - struct v4l2_subdev_format *format) -{ - struct imx214 *imx214 = to_imx214(sd); - - mutex_lock(&imx214->mutex); - format->format = *__imx214_get_pad_format(imx214, sd_state, - format->pad, - format->which); - mutex_unlock(&imx214->mutex); - - return 0; -} - static struct v4l2_rect * __imx214_get_pad_crop(struct imx214 *imx214, struct v4l2_subdev_state *sd_state, @@ -842,7 +827,7 @@ static const struct v4l2_subdev_pad_ops imx214_subdev_pad_ops = { .enum_mbus_code = imx214_enum_mbus_code, .enum_frame_size = imx214_enum_frame_size, .enum_frame_interval = imx214_enum_frame_interval, - .get_fmt = imx214_get_format, + .get_fmt = v4l2_subdev_get_fmt, .set_fmt = imx214_set_format, .get_selection = imx214_get_selection, .init_cfg = imx214_entity_init_cfg, From patchwork Wed Aug 30 04:53:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13369960 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 6C3A7C83F15 for ; Wed, 30 Aug 2023 04:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242088AbjH3Exq (ORCPT ); Wed, 30 Aug 2023 00:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242049AbjH3Exi (ORCPT ); Wed, 30 Aug 2023 00:53:38 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CFF8CC5; Tue, 29 Aug 2023 21:53:36 -0700 (PDT) Received: from umang.jainideasonboard.com (unknown [103.251.226.104]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6C81B10FE; Wed, 30 Aug 2023 06:52:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1693371133; bh=r78Ey/3mCQEZBydNa5/i6pNT9NCVYnpDcX91M+kE4Kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V6xjQeOpkM/4WQkouPbCVZiCcbK8glJ0lRVARV6Hl+wgu2FXA5G8aKv3QeplyG10R 3xajTIs4swufSlEZRozdt8XB2DJJtqXDa4Xc1+IE9oJpk7+aazWmOSDqBH0d1F5BMg aY/SAFiZrRsJy1JRrIs1TB7xwtmXbWtoqX1qJvXg= From: Umang Jain To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Riesch , Sakari Ailus , Mauro Carvalho Chehab , Ricardo Ribalda , Laurent Pinchart , Kieran Bingham , Umang Jain Subject: [PATCH 2/2] media: i2c: imx415: Use v4l2_subdev_get_fmt() Date: Wed, 30 Aug 2023 10:23:23 +0530 Message-Id: <20230830045323.71768-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230830045323.71768-1-umang.jain@ideasonboard.com> References: <20230830045323.71768-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The imx415 driver uses the subdev active state, there's no need to implement the .get_fmt() operation manually. Use the v4l2_subdev_get_fmt() helper instead. Signed-off-by: Umang Jain Reviewed-by: Michael Riesch Reviewed-by: Laurent Pinchart --- drivers/media/i2c/imx415.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/media/i2c/imx415.c b/drivers/media/i2c/imx415.c index 3f00172df3cc..9a7ac81edc28 100644 --- a/drivers/media/i2c/imx415.c +++ b/drivers/media/i2c/imx415.c @@ -842,15 +842,6 @@ static int imx415_enum_frame_size(struct v4l2_subdev *sd, return 0; } -static int imx415_get_format(struct v4l2_subdev *sd, - struct v4l2_subdev_state *state, - struct v4l2_subdev_format *fmt) -{ - fmt->format = *v4l2_subdev_get_pad_format(sd, state, fmt->pad); - - return 0; -} - static int imx415_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_format *fmt) @@ -913,7 +904,7 @@ static const struct v4l2_subdev_video_ops imx415_subdev_video_ops = { static const struct v4l2_subdev_pad_ops imx415_subdev_pad_ops = { .enum_mbus_code = imx415_enum_mbus_code, .enum_frame_size = imx415_enum_frame_size, - .get_fmt = imx415_get_format, + .get_fmt = v4l2_subdev_get_fmt, .set_fmt = imx415_set_format, .get_selection = imx415_get_selection, .init_cfg = imx415_init_cfg,