Re: [PATCH net-next v2 2/3] dpll: add dpll_device op to set working mode

From: Ivan Vecera

Date: Tue Jan 13 2026 - 13:38:54 EST




On 1/13/26 6:47 PM, Vadim Fedorenko wrote:
On 13/01/2026 12:16, Ivan Vecera wrote:
Currently, userspace can retrieve the DPLL working mode but cannot
configure it. This prevents changing the device operation, such as
switching from manual to automatic mode and vice versa.

Add a new callback .mode_set() to struct dpll_device_ops. Extend
the netlink policy and device-set command handling to process
the DPLL_A_MODE attribute.  Update the netlink YAML specification
to include the mode attribute in the device-set operation.

Signed-off-by: Ivan Vecera <ivecera@xxxxxxxxxx>
---
v2:
* fixed bitmap size in dpll_mode_set()

[...]

+static int
+dpll_mode_set(struct dpll_device *dpll, struct nlattr *a,
+          struct netlink_ext_ack *extack)
+{
+    const struct dpll_device_ops *ops = dpll_device_ops(dpll);
+    enum dpll_mode mode = nla_get_u32(a), old_mode;
+    DECLARE_BITMAP(modes, DPLL_MODE_MAX + 1) = { 0 };

this one breaks reverse xmas tree order.

oops, my bad :-(

with this fixed:
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@xxxxxxxxx>

will fix... thanks for pointing this out.

Ivan