From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Link Mauve <linkmauve@linkmauve.fr>
Cc: linux-media@vger.kernel.org,
Sakari Ailus <sakari.ailus@linux.intel.com>,
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: Sun, 20 Sep 2026 21:46:42 +0200 [thread overview]
Message-ID: <arA3TaFiFOx7ubjj@monoceros> (raw)
In-Reply-To: <20260804114625.2314430-4-linkmauve@linkmauve.fr>
[-- Attachment #1: Type: text/plain, Size: 1802 bytes --]
Hello,
On Tue, Aug 04, 2026 at 01:46:23PM +0200, Link Mauve wrote:
> diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c
> index 8775083f4dd6..27f096ce522e 100644
> --- a/drivers/media/dvb-frontends/ts2020.c
> +++ b/drivers/media/dvb-frontends/ts2020.c
> @@ -18,7 +18,6 @@
> struct ts2020_priv {
> struct i2c_client *client;
> struct mutex regmap_mutex;
> - struct regmap_config regmap_config;
> struct regmap *regmap;
> struct dvb_frontend *fe;
> struct delayed_work stat_work;
> @@ -559,6 +558,12 @@ static int ts2020_probe(struct i2c_client *client)
> u8 u8tmp;
> unsigned int utmp;
> char *chip_str;
> + struct regmap_config regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .lock = ts2020_regmap_lock,
> + .unlock = ts2020_regmap_unlock,
> + };
>
> if (!pdata) {
> dev_err(&client->dev, "platform data is mandatory\n");
> @@ -574,12 +579,8 @@ static int ts2020_probe(struct i2c_client *client)
>
> /* create regmap */
> mutex_init(&dev->regmap_mutex);
> - dev->regmap_config.reg_bits = 8;
> - dev->regmap_config.val_bits = 8;
> - dev->regmap_config.lock = ts2020_regmap_lock;
> - dev->regmap_config.unlock = ts2020_regmap_unlock;
> - dev->regmap_config.lock_arg = dev;
> - dev->regmap = regmap_init_i2c(client, &dev->regmap_config);
> + regmap_config.lock_arg = dev;
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);
With or without that approach:
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-09-20 19:46 UTC|newest]
Thread overview: 6+ 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 [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=arA3TaFiFOx7ubjj@monoceros \
--to=u.kleine-koenig@baylibre.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=sakari.ailus@linux.intel.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
all inboxes | Powered by JetHome®