From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CFE6313547; Mon, 26 Jan 2026 10:02:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769421726; cv=none; b=MYSQLJEZvSPzTuc9fR+Yq2r45e+nsZIu0w6oxAyjEYDa82D0Jwc7DuQhXsJI1sHx5uZWdt5Hm0InWkVlkYzxnObe2WhrjNunu8uEwyE6y59rdadtOH1MgKZj4ZvVPyrOHYRZwL/Egbcn2QaN0Y7flflSP2Vfrdsbf98NInbh6po= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769421726; c=relaxed/simple; bh=J+YVfS9Wm2Sk+6m3pp8Ftv4a/hsFTHNzGVuvFwi49Sg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DIwdNU6DygzH6FnVILxPl88qnispvm8JEuGEX7ml8WZBIp8uOGB0LAF9DSpZLLiR4AuPtCJzjRd2qiwSL39/HV/MkOhvswwXZDzx9Etdxsq00WeaSZ8MYDhmZt+l1w0cEZzwUYCmGDHjho9abNFjdDwtiOalWBMPnC7A+INoNy8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=nsZiw8pW; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nsZiw8pW" Received: from pendragon.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id B947422F; Mon, 26 Jan 2026 11:01:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769421679; bh=J+YVfS9Wm2Sk+6m3pp8Ftv4a/hsFTHNzGVuvFwi49Sg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nsZiw8pWIXiX76repnBNWmc7mkmlfDr158AG7SuQecURSNj7jSWZGgf70ofeIx3qW vP3p/21YuoH5BQ6m56oDWTfWaxtPUZWZChuAB1fA0rv7Wh3y5KscpaRAuA2UoQuLrI ZRZbNsGNZkwy//pipljatYeRVzTIOT6Q12ufQC1A= Date: Mon, 26 Jan 2026 12:01:53 +0200 From: Laurent Pinchart To: Ceclan Dumitru Cc: Sakari Ailus , dumitru.ceclan@analog.com, Tomi Valkeinen , Mauro Carvalho Chehab , Julien Massot , Rob Herring , Niklas =?utf-8?Q?S=C3=B6derlund?= , Greg Kroah-Hartman , 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 Subject: Re: [PATCH RESEND v8 17/21] media: i2c: maxim-serdes: add MAX9296A driver Message-ID: <20260126100153.GB593812@killaraus> References: <20251208-gmsl2-3_serdes-v8-0-7b8d457e2e04@analog.com> <20251208-gmsl2-3_serdes-v8-17-7b8d457e2e04@analog.com> <47ce1e14-5443-4d3e-a2c9-7d5be47012c9@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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