public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ceclan Dumitru <mitrutzceclan@gmail.com>
Cc: "Sakari Ailus" <sakari.ailus@linux.intel.com>,
	dumitru.ceclan@analog.com,
	"Tomi Valkeinen" <tomi.valkeinen+renesas@ideasonboard.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Julien Massot" <julien.massot@collabora.com>,
	"Rob Herring" <robh@kernel.org>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-staging@lists.linux.dev,
	"Cosmin Tanislav" <demonsingur@gmail.com>
Subject: Re: [PATCH RESEND v8 17/21] media: i2c: maxim-serdes: add MAX9296A driver
Date: Mon, 26 Jan 2026 12:01:53 +0200	[thread overview]
Message-ID: <20260126100153.GB593812@killaraus> (raw)
In-Reply-To: <47ce1e14-5443-4d3e-a2c9-7d5be47012c9@gmail.com>

On Mon, Jan 26, 2026 at 11:55:47AM +0200, Ceclan Dumitru wrote:
> 
> 
> On 1/20/26 3:34 PM, Sakari Ailus wrote:
> > Hi Dumitru,
> > 
> > On Mon, Dec 08, 2025 at 04:13:09PM +0200, Dumitru Ceclan via B4 Relay wrote:
> >> +	*ops = max9296a_common_ops;
> >> +
> >> +	ops->versions = priv->info->ops->versions;
> >> +	ops->modes = priv->info->ops->modes;
> >> +	ops->needs_single_link_version = priv->info->ops->needs_single_link_version;
> >> +	ops->needs_unique_stream_id = priv->info->ops->needs_unique_stream_id;
> >> +	ops->fix_tx_ids = priv->info->ops->fix_tx_ids;
> >> +	ops->num_phys = priv->info->ops->num_phys;
> >> +	ops->num_pipes = priv->info->ops->num_pipes;
> >> +	ops->num_links = priv->info->ops->num_links;
> >> +	ops->phys_configs = priv->info->ops->phys_configs;
> >> +	ops->set_pipe_enable = priv->info->ops->set_pipe_enable;
> >> +	ops->set_pipe_stream_id = priv->info->ops->set_pipe_stream_id;
> >> +	ops->set_pipe_tunnel_phy = priv->info->ops->set_pipe_tunnel_phy;
> >> +	ops->set_pipe_tunnel_enable = priv->info->ops->set_pipe_tunnel_enable;
> >> +	ops->use_atr = priv->info->ops->use_atr;
> >> +	ops->tpg_mode = priv->info->ops->tpg_mode;
> > 
> > What's the reason for doing these assignments and a copy of the memory? Why
> > not to just keep a pointer to the struct memory instead? I think there's
> > another case of the same.
> > 
> Would this be alright:
> #define MAX9296A_COMMON_OPS					\
> 
> 	.num_remaps_per_pipe = 16,				\
> 
> 	.tpg_entries = { ... },					\
> 
> 	.init = max9296a_init,					\
> 
> 	.set_enable = max9296a_set_enable,			\
> 
> 
> static const struct max_des_ops max9296a_ops = {
> 
> 	MAX9296A_COMMON_OPS,
> 
> 	.versions = BIT(MAX_SERDES_GMSL_2_3GBPS) |
> 
> 		    BIT(MAX_SERDES_GMSL_2_6GBPS),
> 	.modes = BIT(MAX_SERDES_GMSL_PIXEL_MODE),
> 	/* ... */
> 
> 	};
> 
> 
> 
> static int max9296a_probe(struct i2c_client *client)
> 
> {
> 
> 	/* ... */
> 
> 	priv->des.ops = priv->info->ops;
> 
> 	/* ... */
> 
> }

That's still a copy. Why is a copy needed, why can't you write

 	priv->des.ops = &priv->info->ops;

or event replace priv->des.ops with priv->info->ops through the code ?
Is there anything in the ops structure that needs to be modified at
runtime ?

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2026-01-26 10:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 14:12 [PATCH RESEND v8 00/21] media: i2c: add Maxim GMSL2/3 serializer and deserializer drivers Dumitru Ceclan via B4 Relay
2025-12-08 14:12 ` [PATCH RESEND v8 01/21] media: mc: Add INTERNAL pad flag Dumitru Ceclan via B4 Relay
2025-12-08 14:12 ` [PATCH RESEND v8 02/21] dt-bindings: media: i2c: max96717: add support for I2C ATR Dumitru Ceclan via B4 Relay
2025-12-08 14:12 ` [PATCH RESEND v8 03/21] dt-bindings: media: i2c: max96717: add support for pinctrl/pinconf Dumitru Ceclan via B4 Relay
2025-12-08 14:12 ` [PATCH RESEND v8 04/21] dt-bindings: media: i2c: max96717: add support for MAX9295A Dumitru Ceclan via B4 Relay
2025-12-08 14:12 ` [PATCH RESEND v8 05/21] dt-bindings: media: i2c: max96717: add support for MAX96793 Dumitru Ceclan via B4 Relay
2025-12-08 14:12 ` [PATCH RESEND v8 06/21] dt-bindings: media: i2c: max96712: use pattern properties for ports Dumitru Ceclan via B4 Relay
2025-12-08 14:12 ` [PATCH RESEND v8 07/21] dt-bindings: media: i2c: max96712: add support for I2C ATR Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 08/21] dt-bindings: media: i2c: max96712: add support for POC supplies Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 09/21] dt-bindings: media: i2c: max96712: add support for MAX96724F/R Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 10/21] dt-bindings: media: i2c: max96714: add support for MAX96714R Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 11/21] dt-bindings: media: i2c: add MAX9296A, MAX96716A, MAX96792A Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 12/21] media: i2c: add Maxim GMSL2/3 serializer and deserializer framework Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 13/21] media: i2c: add Maxim GMSL2/3 serializer framework Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 14/21] media: i2c: add Maxim GMSL2/3 deserializer framework Dumitru Ceclan via B4 Relay
2026-03-10 16:35   ` Cory Keitz
2025-12-08 14:13 ` [PATCH RESEND v8 15/21] media: i2c: maxim-serdes: add MAX96717 driver Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 16/21] media: i2c: maxim-serdes: add MAX96724 driver Dumitru Ceclan via B4 Relay
2026-03-07 17:03   ` Cory Keitz
2025-12-08 14:13 ` [PATCH RESEND v8 17/21] media: i2c: maxim-serdes: add MAX9296A driver Dumitru Ceclan via B4 Relay
2026-01-20 13:34   ` Sakari Ailus
2026-01-26  9:55     ` Ceclan Dumitru
2026-01-26 10:01       ` Laurent Pinchart [this message]
2026-01-26 11:10         ` Cosmin Tanislav
2026-01-26 21:46       ` Sakari Ailus
2025-12-08 14:13 ` [PATCH RESEND v8 18/21] arm64: defconfig: disable deprecated MAX96712 driver Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 19/21] staging: media: remove " Dumitru Ceclan via B4 Relay
2025-12-08 14:13 ` [PATCH RESEND v8 20/21] media: i2c: remove MAX96717 driver Dumitru Ceclan via B4 Relay
2026-01-21 10:23   ` Sakari Ailus
2025-12-08 14:13 ` [PATCH RESEND v8 21/21] media: i2c: remove MAX96714 driver Dumitru Ceclan via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260126100153.GB593812@killaraus \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=demonsingur@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dumitru.ceclan@analog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=julien.massot@collabora.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mitrutzceclan@gmail.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen+renesas@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox