Skip to content

Commit 96e052d

Browse files
mhklinuxliuw
authored andcommitted
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: Dexuan Cui <[email protected]> Signed-off-by: Michael Kelley <[email protected]> Acked-by: Wei Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]> Message-ID: <[email protected]>
1 parent a9640fc commit 96e052d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/hv/hv_util.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,8 @@ static int util_probe(struct hv_device *dev,
590590
srv->channel = dev->channel;
591591
if (srv->util_init) {
592592
ret = srv->util_init(srv);
593-
if (ret) {
594-
ret = -ENODEV;
593+
if (ret)
595594
goto error1;
596-
}
597595
}
598596

599597
/*

0 commit comments

Comments
 (0)