From patchwork Thu Oct 26 07:03:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 738584 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 5FACDC25B6F for ; Thu, 26 Oct 2023 07:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234833AbjJZHDq (ORCPT ); Thu, 26 Oct 2023 03:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233257AbjJZHDo (ORCPT ); Thu, 26 Oct 2023 03:03:44 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04018198 for ; Thu, 26 Oct 2023 00:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698303821; x=1729839821; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T5aQWbkTFbUM9t4qkxCB/gu5sOVIe3/6I78BW7/IHtA=; b=ko2KQjN4F0IVl9Ym7lqBnofRO9UQTCuBbpJKLAOkFLhwMCkPgMSTzsjA J0XIJnW3u9RZkxe9OosVM09IvWAaWNBf0itHx+cqlEMMPNmQAdb5QYy9r d6xr2RbARxSjpYC/amvYZ+MNtJQoKR3SXHU4P9hB3dMf7wRPQYaOQgAdV 9hJ4Zt2yfTh3qLcWVniOmdxZJjglxAqJ4e5Ob2Wp86a2AjuCmFunPgyEF XJFkZh5a+Q8a4LKPcKH5UNGllCqhkk0Q9TDF/5wIgKexkLpF36vTnUkde FApIp+gREs96IMTh479yy8u7lJ/Nl2P/dP16of3rqVBdU1+ekgc7q8qX9 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="451711535" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="451711535" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 00:03:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10874"; a="902795792" X-IronPort-AV: E=Sophos;i="6.03,253,1694761200"; d="scan'208";a="902795792" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2023 00:01:13 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id CD02712072C; Thu, 26 Oct 2023 10:03:35 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, tomi.valkeinen@ideasonboard.com, jacopo.mondi@ideasonboard.com, bingbu.cao@intel.com, hongju.wang@intel.com, Alain Volmat Subject: [PATCH v4 4/9] media: v4l: subdev: v4l2_subdev_state_get_format always returns format now Date: Thu, 26 Oct 2023 10:03:24 +0300 Message-Id: <20231026070329.948847-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231026070329.948847-1-sakari.ailus@linux.intel.com> References: <20231026070329.948847-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Now that v4l2_subdev_state_get_format() always returns format, don't call alternative v4l2_subdev_get_pad_format() anymore. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen --- drivers/media/v4l2-core/v4l2-subdev.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index 29c43de6eb4b..2a615836c1d4 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -1580,14 +1580,7 @@ int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, { struct v4l2_mbus_framefmt *fmt; - if (sd->flags & V4L2_SUBDEV_FL_STREAMS) - fmt = v4l2_subdev_state_get_format(state, format->pad, - format->stream); - else if (format->pad < sd->entity.num_pads && format->stream == 0) - fmt = v4l2_subdev_get_pad_format(sd, state, format->pad); - else - fmt = NULL; - + fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream); if (!fmt) return -EINVAL;