Skip to content

Commit

Permalink
ptp: Don't print an error if ptp_kvm is not supported
Browse files Browse the repository at this point in the history
Commit 300bb1f ("ptp: arm/arm64: Enable ptp_kvm for arm/arm64")
enable ptp_kvm support for ARM platforms and for any ARM platform that
does not support this, the following error message is displayed ...

 ERR KERN fail to initialize ptp_kvm

For platforms that do not support ptp_kvm this error is a bit misleading
and so fix this by only printing this message if the error returned by
kvm_arch_ptp_init() is not -EOPNOTSUPP. Note that -EOPNOTSUPP is only
returned by ARM platforms today if ptp_kvm is not supported.

Fixes: 300bb1f ("ptp: arm/arm64: Enable ptp_kvm for arm/arm64")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210420132419.1318148-1-jonathanh@nvidia.com
  • Loading branch information
jonhunter authored and Marc Zyngier committed Apr 20, 2021
1 parent 127ce0b commit a86ed2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/ptp/ptp_kvm_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ static int __init ptp_kvm_init(void)

ret = kvm_arch_ptp_init();
if (ret) {
pr_err("fail to initialize ptp_kvm");
if (ret != -EOPNOTSUPP)
pr_err("fail to initialize ptp_kvm");
return ret;
}

Expand Down

0 comments on commit a86ed2c

Please sign in to comment.