interconnect: Do not create empty devres on missing interconnects

of_icc_get() returns NULL on valid case - no interconnects - but no
need to create devres for that, because it just wastes memory without
any use/benefits.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://patch.msgid.link/20260416130912.375013-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
This commit is contained in:
Krzysztof Kozlowski 2026-04-16 15:09:13 +02:00 committed by Georgi Djakov
parent 254f49634e
commit 7562778563

View File

@ -432,7 +432,7 @@ struct icc_path *devm_of_icc_get(struct device *dev, const char *name)
return ERR_PTR(-ENOMEM);
path = of_icc_get(dev, name);
if (!IS_ERR(path)) {
if (!IS_ERR_OR_NULL(path)) {
*ptr = path;
devres_add(dev, ptr);
} else {