diff options
author | Jiri Pirko <jiri@nvidia.com> | 2024-01-30 13:08:30 +0100 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-02-01 15:39:44 +0100 |
commit | e2ca9e75849e63eab6544549b6888595997e8153 (patch) | |
tree | eac6f96bd7b363da6717b2ed7e8bdcc94947b881 /drivers/dpll | |
parent | cf4f0f1e1c465da7c1f6bc89c3ff50bf42f0ab02 (diff) | |
download | linux-stable-e2ca9e75849e63eab6544549b6888595997e8153.tar.gz linux-stable-e2ca9e75849e63eab6544549b6888595997e8153.tar.bz2 linux-stable-e2ca9e75849e63eab6544549b6888595997e8153.zip |
dpll: extend lock_status_get() op by status error and expose to user
Pass additional argunent status_error over lock_status_get()
so drivers can fill it up. In case they do, expose the value over
previously introduced attribute to user. Do it only in case the
current lock_status is either "unlocked" or "holdover".
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/dpll')
-rw-r--r-- | drivers/dpll/dpll_netlink.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c index 314bb3775465..cf3313517ae1 100644 --- a/drivers/dpll/dpll_netlink.c +++ b/drivers/dpll/dpll_netlink.c @@ -121,14 +121,21 @@ dpll_msg_add_lock_status(struct sk_buff *msg, struct dpll_device *dpll, struct netlink_ext_ack *extack) { const struct dpll_device_ops *ops = dpll_device_ops(dpll); + enum dpll_lock_status_error status_error = 0; enum dpll_lock_status status; int ret; - ret = ops->lock_status_get(dpll, dpll_priv(dpll), &status, extack); + ret = ops->lock_status_get(dpll, dpll_priv(dpll), &status, + &status_error, extack); if (ret) return ret; if (nla_put_u32(msg, DPLL_A_LOCK_STATUS, status)) return -EMSGSIZE; + if (status_error && + (status == DPLL_LOCK_STATUS_UNLOCKED || + status == DPLL_LOCK_STATUS_HOLDOVER) && + nla_put_u32(msg, DPLL_A_LOCK_STATUS_ERROR, status_error)) + return -EMSGSIZE; return 0; } |