From patchwork Mon Oct 23 17:44:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 737436 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 795D9C25B46 for ; Mon, 23 Oct 2023 17:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233934AbjJWRo2 (ORCPT ); Mon, 23 Oct 2023 13:44:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233932AbjJWRo1 (ORCPT ); Mon, 23 Oct 2023 13:44:27 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF22E6 for ; Mon, 23 Oct 2023 10:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698083063; x=1729619063; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IiKwA2G9REf//4BLQd551NV3OWHLeXuTUUaQQo3IVtI=; b=Ne3JXn+a8HOSXsKovKL4H01J/j1UhdwMRA+CbOVbz86gfeo5u7yj1MPv i2rTW7yJEBm7eAClWLfzoyxjRfW/rOG99VRx3lA5uMcwu2pCHF6hxiFlS HLn2qlPAjjcwfWO6Xblo0KUagol7Eec7DmVIlI3R7wzFZ1RMqF6OgpA6S DDtKGCxJYf+lNYxJ9V7BIcahYTU9/o7tKqMhEQglNtgCbDrCIa6Lhru00 egeHQduihDhJhRyCFg9M3JgVLIBf4gadtNrzxZskd8c4EFz+Zan4802v0 ilwwe1bhSy2LD1K7Gz7gUKaAWUHEHs9HORLYVRqEMCs4gZemM8OheuqwX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="366238831" X-IronPort-AV: E=Sophos;i="6.03,246,1694761200"; d="scan'208";a="366238831" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2023 10:44:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="751702624" X-IronPort-AV: E=Sophos;i="6.03,246,1694761200"; d="scan'208";a="751702624" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2023 10:44:19 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id BDB8412097D; Mon, 23 Oct 2023 20:44:15 +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 Subject: [PATCH v3 4/8] media: v4l: subdev: v4l2_subdev_state_get_format always returns format now Date: Mon, 23 Oct 2023 20:44:04 +0300 Message-Id: <20231023174408.803874-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231023174408.803874-1-sakari.ailus@linux.intel.com> References: <20231023174408.803874-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 9c267aaef56b..f0f0af48730f 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;