From patchwork Fri Oct 13 10:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 733823 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 33914C41513 for ; Fri, 13 Oct 2023 10:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229903AbjJMKo6 (ORCPT ); Fri, 13 Oct 2023 06:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbjJMKol (ORCPT ); Fri, 13 Oct 2023 06:44:41 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C3F186 for ; Fri, 13 Oct 2023 03:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697193874; x=1728729874; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eGJyFS7yCJdXl+dWkZsOAgAeoYvgHGD/GNIxrgE37lY=; b=QsnI5ueZRUyurd3g1J4+btz1tqt4UkFwZeJaRJk2Aww+kYa1RFMNcB2N rCUYEAG80vy5kiS8SUqwyARQS29AaJlq8UenSvlA8TOt3fRFSH6ckFFL0 jYpXVl+/kyc279eaVXeON+vu0leU7faFLi5rqTENsSiJEN69qWV37tZhV 6q/anqNzf8Y9guPfjiSmy5Hg/8d7udSdEIRJj2ct53VgeO3rm9Gdrkkbt phf5tueAnvr4ii/yCp8n3Rxq/S56154GAgc1QI8rSoYEB8hqo2S9UnLqI GBjpEpGOnOelkay+9boNW/g8jtV49GMlz5Fqi/ckr0VUsa8ll2M/lLrBZ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="388004020" X-IronPort-AV: E=Sophos;i="6.03,221,1694761200"; d="scan'208";a="388004020" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 03:44:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="825016441" X-IronPort-AV: E=Sophos;i="6.03,221,1694761200"; d="scan'208";a="825016441" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 03:44:31 -0700 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id C6C66120AB3; Fri, 13 Oct 2023 13:44:28 +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 4/6] media: v4l: subdev: v4l2_subdev_get_format always returns format now Date: Fri, 13 Oct 2023 13:44:22 +0300 Message-Id: <20231013104424.404768-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231013104424.404768-1-sakari.ailus@linux.intel.com> References: <20231013104424.404768-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_get_format() always returns format, don't call alternative v4l2_subdev_get_pad_format() anymore. Signed-off-by: Sakari Ailus --- 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 a522cd8096cf..153e9b1958d6 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_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_get_format(state, format->pad, format->stream); if (!fmt) return -EINVAL;