[PATCH for-5.8] ASoC: amd: doesn't print error log if the return value is EPROBE_DEFER

Hui Wang hui.wang at canonical.com
Fri May 22 09:47:22 CEST 2020


On 2020/5/21 下午11:43, Mark Brown wrote:
> On Thu, May 21, 2020 at 10:44:34PM +0800, Hui Wang wrote:
>> The machine driver module and codec driver module don't have
>> dependency, it is possible that the machine driver is loaded ahead of
>> the codec driver, then the register_card() will fail and return
>> EPROBE_DEFER, in this case the driver should not print error log since
>> this is not a real failure.
> This isn't helpful to people who are trying to figure out why the driver
> isn't loading - if we silently fail then the user will struggle to
> determine what the problem that causes their driver to fail to bind is.

Yes, you are right. If the codec module is not loaded, the machine 
driver will fail silently.

There are many modules in the kernel, no other modules print the -517 
error or warning, so if this driver prints it, it really confuses users 
(according to my test, the audio works but the kernel prints this error 
with 100% chance, and within ubuntu, the error message is read color, it 
is very easily caught by users).

How about we put off the registering the machine device, this can 
guarantee everything is ready when machine driver's probe is called. I 
will send a V2 according to this idea.

Thanks,

Hui.



More information about the Alsa-devel mailing list