{
struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(component);
struct wcd937x_priv *wcd937x = snd_soc_component_get_drvdata(component);
- struct sdw_slave *tx_sdw_dev = wcd937x->tx_sdw_dev;
struct device *dev = component->dev;
- unsigned long time_left;
int i, ret;
u32 chipid;
- time_left = wait_for_completion_timeout(&tx_sdw_dev->initialization_complete,
- msecs_to_jiffies(5000));
- if (!time_left) {
- dev_err(dev, "soundwire device init timeout\n");
- return -ETIMEDOUT;
- }
+ ret = sdw_slave_wait_for_init(wcd937x->tx_sdw_dev, 5000);
+ if (ret)
+ return ret;
snd_soc_component_init_regmap(component, wcd937x->regmap);
ret = pm_runtime_resume_and_get(dev);