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>
This commit is contained in:
Srinivas Kandagatla
2025-09-09 13:19:51 +01:00
committed by Mark Brown
parent ebaf88c054
commit 45f2c5e1d1
3 changed files with 3 additions and 18 deletions

View File

@@ -187,15 +187,6 @@ int wcd939x_sdw_set_sdw_stream(struct wcd939x_sdw_priv *wcd,
}
EXPORT_SYMBOL_GPL(wcd939x_sdw_set_sdw_stream);
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);
static int wcd9390_update_status(struct sdw_slave *slave,
enum sdw_slave_status status)
{

View File

@@ -3374,10 +3374,10 @@ static int wcd939x_bind(struct device *dev)
}
/* Get regmap from TX SoundWire device */
wcd939x->regmap = wcd939x_swr_get_regmap(wcd939x->sdw_priv[AIF1_CAP]);
if (IS_ERR(wcd939x->regmap)) {
wcd939x->regmap = wcd939x->sdw_priv[AIF1_CAP]->regmap;
if (!wcd939x->regmap) {
dev_err(dev, "could not get TX device regmap\n");
ret = PTR_ERR(wcd939x->regmap);
ret = -ENODEV;
goto err_remove_rx_link;
}

View File

@@ -918,8 +918,6 @@ int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai);
struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd);
#else
static inline int wcd939x_sdw_free(struct wcd939x_sdw_priv *wcd,
@@ -944,10 +942,6 @@ static inline int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
return -EOPNOTSUPP;
}
struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd)
{
return PTR_ERR(-EINVAL);
}
#endif /* CONFIG_SND_SOC_WCD939X_SDW */
#endif /* __WCD939X_H__ */