Commit 96e052d1 authored by Michael Kelley's avatar Michael Kelley Committed by Wei Liu
Browse files

Drivers: hv: util: Don't force error code to ENODEV in util_probe()



If the util_init function call in util_probe() returns an error code,
util_probe() always return ENODEV, and the error code from the util_init
function is lost. The error message output in the caller, vmbus_probe(),
doesn't show the real error code.

Fix this by just returning the error code from the util_init function.
There doesn't seem to be a reason to force ENODEV, as other errors
such as ENOMEM can already be returned from util_probe(). And the
code in call_driver_probe() implies that ENODEV should mean that a
matching driver wasn't found, which is not the case here.

Suggested-by: default avatarDexuan Cui <decui@microsoft.com>
Signed-off-by: default avatarMichael Kelley <mhklinux@outlook.com>
Acked-by: default avatarWei Liu <wei.liu@kernel.org>
Link: https://lore.kernel.org/r/20241106154247.2271-2-mhklinux@outlook.com


Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
Message-ID: <20241106154247.2271-2-mhklinux@outlook.com>
parent a9640fcd
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -590,11 +590,9 @@ static int util_probe(struct hv_device *dev,
	srv->channel = dev->channel;
	if (srv->util_init) {
		ret = srv->util_init(srv);
		if (ret) {
			ret = -ENODEV;
		if (ret)
			goto error1;
	}
	}

	/*
	 * The set of services managed by the util driver are not performance