Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3644803rdh; Mon, 27 Nov 2023 22:40:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIsTEx5uzD8iZHe+Zh6DlhxA5kzemHobfCJS3rXrkKKLVut/UYUl6Xp45cT1RK/XtyQKD4 X-Received: by 2002:a81:85c7:0:b0:59b:5696:c33 with SMTP id v190-20020a8185c7000000b0059b56960c33mr14121056ywf.46.1701153624323; Mon, 27 Nov 2023 22:40:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701153624; cv=none; d=google.com; s=arc-20160816; b=vx0tDA1/etkZ+EJiooubw39GrqElfEUl+L0uTuo3Fv7IPKht9rMKUht/7eHBaB4B80 FAIugXzEdeGuVeR+AQ1SXRyCg3bpYz2ds9qXiEmj6WczkY4vNEWg/9PtkNsi9+1+btE4 y00qjJjMttC+/BlqjWQW0+eVOT/8j80vHW4qd3HSzIIlC+lb7boRK3ijL8FpKoEaFnb9 RfOKO9rHwR2HP+bzcqPEK5c+6dCRIT7SNfvXGqIkp5qHxzCUPUfAhyTy7Z0sgjiUoZlZ lsK8ssfLc4jLnjbyE56TxPH2ULpl+h6q8qnWpT2ntCaEDmH0AwGqOwKDJzLeJZipBatU ea3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sqFS/+Pxk36pdimX8S2Gwy2kd6DYmdePieb7/PLHPpI=; fh=5AoVCKIV69iXfDU9xoVQehnwQhvkMenLdaEgJyCwGsw=; b=LsYE97KzKKG9ZcuWnbClMxw+BYUFVWxmSEWfmvpjaDDuV9nCxvVNctiQRGzBYjHZrY p5wtxsP+0xmowqDWNIaaVjfIS4Q5Rz8L6vNVQJO5aEv3j/rBQ5cMC14AQQNLnfUh/i6y RIGrNMtneMKvHVLesmUPSSQVGpqg9+/+5gtnCMGlMugxpg8o6/rSYTvQkKkoUUdX5fpV G5ukSHObcOO7F5UaextTkWz/EK/zh+Eq8rRB9CLhppCali8t3gSsQGOF30mOuLdnhfk7 qK13buSJ3h12epKjItzubYqiFNUTkW4HUUIJrUkkGjOACvookAH0XbXREgkKfM7qH+rH 6aZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K3v9Mp2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id s18-20020a635252000000b005b96d038729si11550235pgl.728.2023.11.27.22.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 22:40:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K3v9Mp2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A6B2681829EF; Mon, 27 Nov 2023 22:40:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232892AbjK1GkE (ORCPT + 99 others); Tue, 28 Nov 2023 01:40:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231540AbjK1GkC (ORCPT ); Tue, 28 Nov 2023 01:40:02 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C51B194; Mon, 27 Nov 2023 22:40:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701153608; x=1732689608; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=lH2TN34CUFQU5hAf3pr7Vjg8a3BXiSZCqeRM4bcgPlw=; b=K3v9Mp2RfbVSebX3npUkcoyYcNZ5hzycE1SSy+SfnIGRbqPpJ26qx7Pl 6dFtIuGJqD8q64tmiudxJqGo3gWRNhIyshrQhLpMkV2PAI7iUj7EPu2aV KEb9XG+KzpFI64GbnUa8IRYhw/Hh4hMTiSklFc3MLb8ERmpwnyOxS3Mkh PIL0nyyoLZ1u5l4Lxg7JxJY0zpSksnm5syxPfeLulXjgsspMKEqE/ndBc FxQFDaV4uluzJ5IUTvEQaKbQlmKkQ0FkIuZQOam/JeMvFKTfO3DiC9FB9 Ifq/SZD4q6qOoJ21fg2wf8haWC48OfpyXTbdChmUYQF5r2Td4cUs45a1b A==; X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="373031922" X-IronPort-AV: E=Sophos;i="6.04,233,1695711600"; d="scan'208";a="373031922" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 22:40:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10907"; a="718288182" X-IronPort-AV: E=Sophos;i="6.04,233,1695711600"; d="scan'208";a="718288182" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 22:40:05 -0800 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 9768C11F76A; Tue, 28 Nov 2023 08:40:02 +0200 (EET) Date: Tue, 28 Nov 2023 06:40:02 +0000 From: Sakari Ailus To: Alain Volmat Cc: Mauro Carvalho Chehab , Benjamin Mugnier , Sylvain Petinot , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/7] media: i2c: st-mipid02: use active state to store pad formats Message-ID: References: <20231125182057.1379357-1-alain.volmat@foss.st.com> <20231125182057.1379357-5-alain.volmat@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231125182057.1379357-5-alain.volmat@foss.st.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 27 Nov 2023 22:40:21 -0800 (PST) On Sat, Nov 25, 2023 at 07:20:52PM +0100, Alain Volmat wrote: > Store formats information within pad allowing to simplify further more > the driver (mutex / format store within the driver structure no more > necessary). > > Signed-off-by: Alain Volmat Applied with the following diff: diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index 7af209905d7b..2cc07b3ed0da 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -563,8 +563,8 @@ static const struct v4l2_mbus_framefmt default_fmt = { .height = 480, }; -static int mipid02_init_cfg(struct v4l2_subdev *sd, - struct v4l2_subdev_state *state) +static int mipid02_init_state(struct v4l2_subdev *sd, + struct v4l2_subdev_state *state) { *v4l2_subdev_state_get_format(state, MIPID02_SINK_0) = default_fmt; /* MIPID02_SINK_1 isn't supported yet */ @@ -642,7 +642,6 @@ static const struct v4l2_subdev_video_ops mipid02_video_ops = { }; static const struct v4l2_subdev_pad_ops mipid02_pad_ops = { - .init_cfg = mipid02_init_cfg, .enum_mbus_code = mipid02_enum_mbus_code, .get_fmt = v4l2_subdev_get_fmt, .set_fmt = mipid02_set_fmt, @@ -653,6 +652,10 @@ static const struct v4l2_subdev_ops mipid02_subdev_ops = { .pad = &mipid02_pad_ops, }; +static const struct v4l2_subdev_internal_ops mipid02_subdev_internal_ops = { + .init_state = mipid02_init_state, +}; + static const struct media_entity_operations mipid02_subdev_entity_ops = { .link_validate = v4l2_subdev_link_validate, }; @@ -851,6 +854,7 @@ static int mipid02_probe(struct i2c_client *client) bridge->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; bridge->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; + bridge->sd.internal_ops = &mipid02_subdev_internal_ops; bridge->sd.entity.ops = &mipid02_subdev_entity_ops; bridge->pad[0].flags = MEDIA_PAD_FL_SINK; bridge->pad[1].flags = MEDIA_PAD_FL_SINK; -- Sakari Ailus