Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

driver core: Make dev_err_probe() silent for -ENOMEM

For an out-of-memory error there should be no additional output. Adapt
dev_err_probe() to not emit the error message when err is -ENOMEM.
This simplifies handling errors that might among others be -ENOMEM.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/3d1e308d45cddf67749522ca42d83f5b4f0b9634.1718311756.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
2f3cfd2f de658283

+14 -3
+14 -3
drivers/base/core.c
··· 5021 5021 vaf.fmt = fmt; 5022 5022 vaf.va = &args; 5023 5023 5024 - if (err != -EPROBE_DEFER) { 5025 - dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf); 5026 - } else { 5024 + switch (err) { 5025 + case -EPROBE_DEFER: 5027 5026 device_set_deferred_probe_reason(dev, &vaf); 5028 5027 dev_dbg(dev, "error %pe: %pV", ERR_PTR(err), &vaf); 5028 + break; 5029 + 5030 + case -ENOMEM: 5031 + /* 5032 + * We don't print anything on -ENOMEM, there is already enough 5033 + * output. 5034 + */ 5035 + break; 5036 + 5037 + default: 5038 + dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf); 5039 + break; 5029 5040 } 5030 5041 5031 5042 va_end(args);