Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: wcd939x: get regmap directly

for 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 get regmap.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20250909121954.225833-11-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Srinivas Kandagatla and committed by
Mark Brown
45f2c5e1 ebaf88c0

+3 -18
-9
sound/soc/codecs/wcd939x-sdw.c
··· 187 187 } 188 188 EXPORT_SYMBOL_GPL(wcd939x_sdw_set_sdw_stream); 189 189 190 - struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd) 191 - { 192 - if (wcd->regmap) 193 - return wcd->regmap; 194 - 195 - return ERR_PTR(-EINVAL); 196 - } 197 - EXPORT_SYMBOL_GPL(wcd939x_swr_get_regmap); 198 - 199 190 static int wcd9390_update_status(struct sdw_slave *slave, 200 191 enum sdw_slave_status status) 201 192 {
+3 -3
sound/soc/codecs/wcd939x.c
··· 3374 3374 } 3375 3375 3376 3376 /* Get regmap from TX SoundWire device */ 3377 - wcd939x->regmap = wcd939x_swr_get_regmap(wcd939x->sdw_priv[AIF1_CAP]); 3378 - if (IS_ERR(wcd939x->regmap)) { 3377 + wcd939x->regmap = wcd939x->sdw_priv[AIF1_CAP]->regmap; 3378 + if (!wcd939x->regmap) { 3379 3379 dev_err(dev, "could not get TX device regmap\n"); 3380 - ret = PTR_ERR(wcd939x->regmap); 3380 + ret = -ENODEV; 3381 3381 goto err_remove_rx_link; 3382 3382 } 3383 3383
-6
sound/soc/codecs/wcd939x.h
··· 918 918 struct snd_pcm_substream *substream, 919 919 struct snd_pcm_hw_params *params, 920 920 struct snd_soc_dai *dai); 921 - 922 - struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd); 923 921 #else 924 922 925 923 static inline int wcd939x_sdw_free(struct wcd939x_sdw_priv *wcd, ··· 942 944 return -EOPNOTSUPP; 943 945 } 944 946 945 - struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd) 946 - { 947 - return PTR_ERR(-EINVAL); 948 - } 949 947 #endif /* CONFIG_SND_SOC_WCD939X_SDW */ 950 948 951 949 #endif /* __WCD939X_H__ */