driver core: Add device probe log helper dev_warn_probe()
authorDragan Simic <dsimic@manjaro.org>
Sun, 29 Sep 2024 09:21:16 +0000 (11:21 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 8 Oct 2024 17:41:06 +0000 (18:41 +0100)
commit36e69b160705b65bf136c2fb6a1194447eeb8478
treeb1d4dee0b4a561cb5d3850243a2fa0a911fdabcf
parent7d46b8d8d78338a2ad986eec0790ddb22fad23a8
driver core: Add device probe log helper dev_warn_probe()

Some drivers can still provide their functionality to a certain extent
even when some of their resource acquisitions eventually fail.  In such
cases, emitting errors isn't the desired action, but warnings should be
emitted instead.

To solve this, introduce dev_warn_probe() as a new device probe log helper,
which behaves identically as the already existing dev_err_probe(), while it
produces warnings instead of errors.  The intended use is with the resources
that are actually optional for a particular driver.

While there, copyedit the kerneldoc for dev_err_probe() a bit, to simplify
its wording a bit, and reuse it as the kerneldoc for dev_warn_probe(), with
the necessary wording adjustments, of course.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Tested-by: Hélène Vulquin <oss@helene.moe>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2be0a28538bb2a3d1bcc91e2ca1f2d0dc09146d9.1727601608.git.dsimic@manjaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/core.c
include/linux/dev_printk.h