Skip to content

Commit 5e7aa97

Browse files
t-8chkuba-moo
authored andcommitted
ptp: kvm: x86: Return EOPNOTSUPP instead of ENODEV from kvm_arch_ptp_init()
The caller, ptp_kvm_init(), emits a warning if kvm_arch_ptp_init() exits with any error which is not EOPNOTSUPP: "fail to initialize ptp_kvm" Replace ENODEV with EOPNOTSUPP to avoid this spurious warning, aligning with the ARM implementation. Fixes: a86ed2c ("ptp: Don't print an error if ptp_kvm is not supported") Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bd0c907 commit 5e7aa97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/ptp/ptp_kvm_x86.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int kvm_arch_ptp_init(void)
2626
long ret;
2727

2828
if (!kvm_para_available())
29-
return -ENODEV;
29+
return -EOPNOTSUPP;
3030

3131
if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
3232
p = alloc_page(GFP_KERNEL | __GFP_ZERO);
@@ -46,14 +46,14 @@ int kvm_arch_ptp_init(void)
4646

4747
clock_pair_gpa = slow_virt_to_phys(clock_pair);
4848
if (!pvclock_get_pvti_cpu0_va()) {
49-
ret = -ENODEV;
49+
ret = -EOPNOTSUPP;
5050
goto err;
5151
}
5252

5353
ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa,
5454
KVM_CLOCK_PAIRING_WALLCLOCK);
5555
if (ret == -KVM_ENOSYS) {
56-
ret = -ENODEV;
56+
ret = -EOPNOTSUPP;
5757
goto err;
5858
}
5959

0 commit comments

Comments
 (0)