lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6de11c01-5b59-4222-9f4a-c951c74f0128@oss.qualcomm.com>
Date: Wed, 16 Jul 2025 15:36:24 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@....qualcomm.com>
To: Mark Brown <broonie@...nel.org>
Cc: lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.com, srini@...nel.org,
        linux-kernel@...r.kernel.org, linux-sound@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, neil.armstrong@...aro.org,
        krzysztof.kozlowski@...aro.org
Subject: Re: [PATCH 4/5] ASoC: codecs: wcd939x: move to using dev_get_regmap

On 7/16/25 3:31 PM, Mark Brown wrote:
> On Wed, Jul 16, 2025 at 01:33:22PM +0100, srinivas.kandagatla@....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
Thanks Mark, I did not realize that dev_get_regmap was devres search at
the end, Will drop this patch and make something similar changes to
other codecs too.

--srini
> passed a struct device.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ