From: Mark Brown <broonie@kernel.org>
To: srinivas.kandagatla@oss.qualcomm.com
Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
srini@kernel.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
neil.armstrong@linaro.org, krzysztof.kozlowski@linaro.org
Subject: Re: [PATCH 4/5] ASoC: codecs: wcd939x: move to using dev_get_regmap
Date: Wed, 16 Jul 2025 15:31:21 +0100 [thread overview]
Message-ID: <9f4c750a-9e23-45a0-a761-4c3fc2c7d8c9@sirena.org.uk> (raw)
In-Reply-To: <20250716123323.5831-5-srinivas.kandagatla@oss.qualcomm.com>
[-- Attachment #1: Type: text/plain, Size: 1135 bytes --]
On Wed, Jul 16, 2025 at 01:33:22PM +0100, srinivas.kandagatla@oss.qualcomm.com wrote:
> Ffor some reason we ended up with a boiler plate for dev_get_regmap in
> wcd939x codec and started exporting a symbol for this. Remove this
> redundant wrapper and direclty use dev_get_regmap from device pointer..
> -struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd)
> -{
> - if (wcd->regmap)
> - return wcd->regmap;
> -
> - return ERR_PTR(-EINVAL);
> -}
> -EXPORT_SYMBOL_GPL(wcd939x_swr_get_regmap);
> /* Get regmap from TX SoundWire device */
> - wcd939x->regmap = wcd939x_swr_get_regmap(wcd939x->sdw_priv[AIF1_CAP]);
> - if (IS_ERR(wcd939x->regmap)) {
> + wcd939x->regmap = dev_get_regmap(wcd939x->txdev, NULL);
> + if (!wcd939x->regmap) {
The existing code should be more efficient than dev_get_regmap(), the
latter does a devres_find() to look up the regmap while the above is
just a pointer dereference. It's probably a marginal difference in the
context of probe() but there is a reason to do something more direct if
you can, dev_get_regmap() is mainly intended for generic APIs that get
passed a struct device.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-07-16 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 12:33 [PATCH 0/5] ASoC: codecs: wcd93xxx: remove code duplication srinivas.kandagatla
2025-07-16 12:33 ` [PATCH 1/5] ASoC: codecs: wcd: add common helper for wcd codecs srinivas.kandagatla
2025-07-16 12:33 ` [PATCH 2/5] ASoC: codecs: wcd-common: move WCD_SDW_CH to common srinivas.kandagatla
2025-07-16 12:33 ` [PATCH 3/5] ASoC: codecs: wcd-common: move component ops " srinivas.kandagatla
2025-07-16 12:33 ` [PATCH 4/5] ASoC: codecs: wcd939x: move to using dev_get_regmap srinivas.kandagatla
2025-07-16 14:31 ` Mark Brown [this message]
2025-07-16 14:36 ` Srinivas Kandagatla
2025-07-16 15:38 ` Srinivas Kandagatla
2025-07-16 12:33 ` [PATCH 5/5] ASoC: codecs: wcd-common: move status_update callback to common srinivas.kandagatla
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=9f4c750a-9e23-45a0-a761-4c3fc2c7d8c9@sirena.org.uk \
--to=broonie@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=perex@perex.cz \
--cc=srini@kernel.org \
--cc=srinivas.kandagatla@oss.qualcomm.com \
--cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).