]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: Clarify error message for "id == NULL" in _regulator_get()
authorChen-Yu Tsai <wenst@chromium.org>
Thu, 22 Aug 2024 07:20:44 +0000 (15:20 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 22 Aug 2024 12:34:28 +0000 (13:34 +0100)
The original error message simply said "get() with no identifier"
without any context as to what was requested or what device the
request was related to. The only thing the user or developer could
do was grep for the message in the full source tree.

Amend the error message to be more specific, and also use dev_*
to associate the error message with a device.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20240822072047.3097740-2-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c

index 7674b7f2df147b4b99ad7069b39409a0235fa853..9029de5395ee65ec9fc2a9ca3eb6c6ef81a6e44d 100644 (file)
@@ -2183,7 +2183,7 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
        }
 
        if (id == NULL) {
-               pr_err("get() with no identifier\n");
+               dev_err(dev, "regulator request with no identifier\n");
                return ERR_PTR(-EINVAL);
        }