From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Link Mauve <linkmauve@linkmauve.fr>,
linux-media@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Bradford Love <brad@nextdimension.cc>,
Kees Cook <kees@kernel.org>,
Deepanshu Kartikey <kartikey406@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] media: ts2020: put regmap_config on the stack
Date: Tue, 22 Sep 2026 11:05:28 +0300 [thread overview]
Message-ID: <arI2yHgu5S6GFJb2@kekkonen.localdomain> (raw)
In-Reply-To: <arF61V7vW3EWZxG8@monoceros>
On Mon, Sep 21, 2026 at 08:45:49PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> On Mon, Sep 21, 2026 at 07:00:55PM +0200, Link Mauve wrote:
> > On Sun, Sep 20, 2026 at 09:46:42PM +0200, Uwe Kleine-König wrote:
> > > If desired you can keep all the assignments here using:
> > >
> > > regmap_config = (typeof(regmap_config)){
> > > .reg_bits = 8,
> > > .val_bits = 8,
> > > .lock = ts2020_regmap_lock,
> > > .unlock = ts2020_regmap_unlock,
> > > .lock_arg = dev,
> > > };
> > >
> > > > + dev->regmap = regmap_init_i2c(client, ®map_config);
> >
> > I think I still prefer my approach, there is very little usage of the
> > typeof() pattern in the kernel, the only benefit would be to keep
> > lock_arg in the same location as the rest of the initial values.
>
> If it's just the typeof you don't like, you can also use:
>
> regmap_config = (struct regmap_config){
> .reg_bits = 8,
> ...
> };
>
It's also possible to declare it here and so avoid the cast. The current
patch seems fine though, albeit the variable declarations don't remotely
look like a reverse Christmas tree (not that they did before it).
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
--
Sakari Ailus
next prev parent reply other threads:[~2026-09-22 8:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 11:46 [PATCH 0/3] Remove regmap_config struct from allocated data Link Mauve
2026-08-04 11:46 ` [PATCH 1/3] media: rtl2832: make regmap_config static const Link Mauve
2026-08-04 11:46 ` [PATCH 2/3] media: m88ds3103: " Link Mauve
2026-08-04 11:46 ` [PATCH 3/3] media: ts2020: put regmap_config on the stack Link Mauve
2026-09-20 19:46 ` Uwe Kleine-König
2026-09-21 17:00 ` Link Mauve
2026-09-21 18:45 ` Uwe Kleine-König
2026-09-22 8:05 ` Sakari Ailus [this message]
2026-09-20 16:31 ` [PATCH 0/3] Remove regmap_config struct from allocated data Link Mauve
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=arI2yHgu5S6GFJb2@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=brad@nextdimension.cc \
--cc=hverkuil+cisco@kernel.org \
--cc=kartikey406@gmail.com \
--cc=kees@kernel.org \
--cc=linkmauve@linkmauve.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=u.kleine-koenig@baylibre.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