[PATCH RFC net-next 11/19] dpll: drop the cached module name of a pin
From: Ivan Vecera
Date: Thu Nov 26 2026 - 15:35:00 EST
Commit c191b319f208 ("dpll: allow registering FW-identified pin with a
different DPLL") cached the module name in the pin, because a pin that
another driver registered with its DPLL could stay registered after the
module that created the pin was removed. Every pin is now registered by
the driver that created it, with its DPLLs or under a parent pin, and a
driver unregisters its pins before its module goes away.
Read the module name from the module again.
Signed-off-by: Ivan Vecera <ivecera@xxxxxxxxxx>
---
drivers/dpll/dpll_core.c | 1 -
drivers/dpll/dpll_core.h | 2 --
drivers/dpll/dpll_netlink.c | 6 +++---
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
index 2371b81181471d..7440b174c3de2b 100644
--- a/drivers/dpll/dpll_core.c
+++ b/drivers/dpll/dpll_core.c
@@ -653,7 +653,6 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
pin->pin_idx = pin_idx;
pin->clock_id = clock_id;
pin->module = module;
- strscpy(pin->module_name, module_name(module));
if (WARN_ON(prop->type < DPLL_PIN_TYPE_MUX ||
prop->type > DPLL_PIN_TYPE_MAX)) {
ret = -EINVAL;
diff --git a/drivers/dpll/dpll_core.h b/drivers/dpll/dpll_core.h
index 1b3c74ef4c1b42..3b7e0af7f7ee6f 100644
--- a/drivers/dpll/dpll_core.h
+++ b/drivers/dpll/dpll_core.h
@@ -45,7 +45,6 @@ struct dpll_device {
* @pin_idx: index of a pin given by dev driver
* @clock_id: clock_id of creator
* @module: module of creator
- * @module_name: module name of creator
* @fwnode: optional reference to firmware node
* @links: links to other pins (struct dpll_pin_link)
* @dpll_refs: hold referencees to dplls pin was registered with
@@ -61,7 +60,6 @@ struct dpll_pin {
u32 pin_idx;
u64 clock_id;
struct module *module;
- char module_name[MODULE_NAME_LEN];
struct fwnode_handle *fwnode;
struct list_head links;
struct xarray dpll_refs;
diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
index 78017aae19a6f2..372de086a7eb3d 100644
--- a/drivers/dpll/dpll_netlink.c
+++ b/drivers/dpll/dpll_netlink.c
@@ -754,7 +754,7 @@ dpll_cmd_pin_get_one(struct sk_buff *msg, struct dpll_pin *pin,
if (ret)
return ret;
if (nla_put_string(msg, DPLL_A_PIN_MODULE_NAME,
- pin->module_name))
+ module_name(pin->module)))
return -EMSGSIZE;
if (nla_put_64bit(msg, DPLL_A_PIN_CLOCK_ID, sizeof(pin->clock_id),
&pin->clock_id, DPLL_A_PIN_PAD))
@@ -1630,9 +1630,9 @@ dpll_pin_find(u64 clock_id, struct nlattr *mod_name_attr,
xa_for_each_marked(&dpll_pin_xa, i, pin, DPLL_REGISTERED) {
prop = &pin->prop;
cid_match = clock_id ? pin->clock_id == clock_id : true;
- mod_match = mod_name_attr && pin->module_name[0] ?
+ mod_match = mod_name_attr && module_name(pin->module) ?
!nla_strcmp(mod_name_attr,
- pin->module_name) : true;
+ module_name(pin->module)) : true;
type_match = type ? prop->type == type : true;
board_match = board_label ? (prop->board_label ?
!nla_strcmp(board_label, prop->board_label) : false) :
--
2.56.1