Skip to content

Commit 45f2c5e

Browse files
Srinivas Kandagatlabroonie
authored andcommitted
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>
1 parent ebaf88c commit 45f2c5e

3 files changed

Lines changed: 3 additions & 18 deletions

File tree

sound/soc/codecs/wcd939x-sdw.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,6 @@ int wcd939x_sdw_set_sdw_stream(struct wcd939x_sdw_priv *wcd,
187187
}
188188
EXPORT_SYMBOL_GPL(wcd939x_sdw_set_sdw_stream);
189189

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-
199190
static int wcd9390_update_status(struct sdw_slave *slave,
200191
enum sdw_slave_status status)
201192
{

sound/soc/codecs/wcd939x.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3374,10 +3374,10 @@ static int wcd939x_bind(struct device *dev)
33743374
}
33753375

33763376
/* 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) {
33793379
dev_err(dev, "could not get TX device regmap\n");
3380-
ret = PTR_ERR(wcd939x->regmap);
3380+
ret = -ENODEV;
33813381
goto err_remove_rx_link;
33823382
}
33833383

sound/soc/codecs/wcd939x.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,6 @@ int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,
918918
struct snd_pcm_substream *substream,
919919
struct snd_pcm_hw_params *params,
920920
struct snd_soc_dai *dai);
921-
922-
struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd);
923921
#else
924922

925923
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,
944942
return -EOPNOTSUPP;
945943
}
946944

947-
struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd)
948-
{
949-
return PTR_ERR(-EINVAL);
950-
}
951945
#endif /* CONFIG_SND_SOC_WCD939X_SDW */
952946

953947
#endif /* __WCD939X_H__ */

0 commit comments

Comments
 (0)