Commit 2c5d234d authored by Rahul Rameshbabu's avatar Rahul Rameshbabu Committed by Jakub Kicinski

ptp: Make max_phase_adjustment sysfs device attribute invisible when not supported

The .adjphase operation is an operation that is implemented only by certain
PHCs. The sysfs device attribute node for querying the maximum phase
adjustment supported should not be exposed on devices that do not support
.adjphase.

Fixes: c3b60ab7 ("ptp: Add .getmaxphase callback to ptp_clock_info")
Signed-off-by: default avatarRahul Rameshbabu <rrameshbabu@nvidia.com>
Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
Reported-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/netdev/20230627162146.GA114473@dev-arch.thelio-3990X/
Link: https://lore.kernel.org/all/CA+G9fYtKCZeAUTtwe69iK8Xcz1mOKQzwcy49wd+imZrfj6ifXA@mail.gmail.com/Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Reviewed-by: default avatarPetr Vorel <pvorel@suse.cz>
Message-ID: <20230627232139.213130-1-rrameshbabu@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent acd97558
......@@ -358,6 +358,9 @@ static umode_t ptp_is_attribute_visible(struct kobject *kobj,
attr == &dev_attr_max_vclocks.attr) {
if (ptp->is_virtual_clock)
mode = 0;
} else if (attr == &dev_attr_max_phase_adjustment.attr) {
if (!info->adjphase || !info->getmaxphase)
mode = 0;
}
return mode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment