[PATCH v2 0/2] Improve handling of -ENOMEM in dev_err_probe()

From: Uwe Kleine-König
Date: Thu Jun 13 2024 - 17:24:23 EST


From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>

Hello,

the first patch is just a (trivial) forward port of
https://lore.kernel.org/lkml/20240412164405.335657-2-u.kleine-koenig@xxxxxxxxxxxxxx
to today's next.

In reply to the above mentioned patch submission Andy Shevchenko
suggested to make passing -ENOMEM unconditionally to dev_err_probe()
(i.e. handling the return value of a function that can only succeed or
return -ENOMEM) a build error. I'm not convinced, but for the purpose to
show good will and get the first patch in, I implemented that in the 2nd
patch. See the comments in that mail for my concerns.

After some discussion about Andy's concern the (implicit) v1 thread
died. To get the discussion going again here comes another patch
submission for these ideas.

Best regards
Uwe

Uwe Kleine-König (2):
driver core: Make dev_err_probe() silent for -ENOMEM
driver core: Don't allow passing a -ENOMEM to dev_err_probe()

drivers/base/core.c | 21 ++++++++++++++++-----
include/linux/dev_printk.h | 8 +++++++-
2 files changed, 23 insertions(+), 6 deletions(-)

base-commit: 6906a84c482f098d31486df8dc98cead21cce2d0
--
2.43.0