summaryrefslogtreecommitdiff
path: root/drivers/base/class.c
diff options
context:
space:
mode:
authorZijun Hu <quic_zijuhu@quicinc.com>2024-11-05 08:20:23 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-12 13:10:43 +0100
commitf659e8fb8f075dfcc0bd6800935f78ec021c7f25 (patch)
tree217919edc22ec7ad5c74ba10b88d9cc3627f9fce /drivers/base/class.c
parent2d038efcb4b3e3b9a1d117b3c971364926e59082 (diff)
downloadlwn-f659e8fb8f075dfcc0bd6800935f78ec021c7f25.tar.gz
lwn-f659e8fb8f075dfcc0bd6800935f78ec021c7f25.zip
driver core: class: Correct WARN() message in APIs class_(for_each|find)_device()
For both API class_for_each_device(const struct class *class, ...) and class_find_device(const struct class *class, ...), their WARN() messages prompt @class was not initialized when suffer class_to_subsys(@class) error, but the error actually means @class was not registered, so these warning messages are not accurate. Fix by replacing term initialized with registered within these messages. Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/r/20241105-class_fix-v1-2-80866f9994a5@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r--drivers/base/class.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index cb5359235c70..582b5a02a5c4 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -405,7 +405,7 @@ int class_for_each_device(const struct class *class, const struct device *start,
if (!class)
return -EINVAL;
if (!sp) {
- WARN(1, "%s called for class '%s' before it was initialized",
+ WARN(1, "%s called for class '%s' before it was registered",
__func__, class->name);
return -EINVAL;
}
@@ -453,7 +453,7 @@ struct device *class_find_device(const struct class *class, const struct device
if (!class)
return NULL;
if (!sp) {
- WARN(1, "%s called for class '%s' before it was initialized",
+ WARN(1, "%s called for class '%s' before it was registered",
__func__, class->name);
return NULL;
}