linux
linux copied to clipboard
ASoC: sdw_utils: remove dai registered check
For some reason, we check if the DAI is registered before checking the endpoint is present. It will cause problem if the codec driver doesn't register the DAI of the unexist endpoint.
@charleskeepax Can you remind me why we added the DAI registered check? I vaguely remember below code could return error in a few corner cases. But I can't remember which cases are they.
sdw_dev = bus_find_device_by_name(&sdw_bus_type, NULL, sdw_codec_name);
if (!sdw_dev) {
dev_err(dev, "codec %s not found\n", sdw_codec_name);
return -EINVAL;
}
slave = dev_to_sdw_dev(sdw_dev);
if (!slave) {
ret = -EINVAL;
goto put_device;
}
I tested on my ARL + cs42l43 device and blocked list the snd_soc_cs42l43 module and load it later and it seems work fine.