[PATCH 1/8] usb: typec: tcpm: allocate pd_list entries non device managed
From: Sebastian Reichel
Date: Fri Nov 13 2026 - 12:31:24 EST
The data is free'd manually, so there is no need for the device
managed overhead. At the same time it conflicts when the TCPM
itself is registered device managed (not yet supported).
Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
---
drivers/usb/typec/tcpm/tcpm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index bb90211660ca..07d2a03d2b8d 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -8092,7 +8092,7 @@ static void tcpm_port_unregister_pd(struct tcpm_port *port)
for (i = 0; i < port->pd_count; i++) {
usb_power_delivery_unregister_capabilities(port->pd_list[i]->sink_cap);
usb_power_delivery_unregister_capabilities(port->pd_list[i]->source_cap);
- devm_kfree(port->dev, port->pd_list[i]);
+ kfree(port->pd_list[i]);
port->pd_list[i] = NULL;
usb_power_delivery_unregister(port->pds[i]);
port->pds[i] = NULL;
@@ -8391,7 +8391,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode
}
for (i = 0; i < port->pd_count; i++) {
- port->pd_list[i] = devm_kzalloc_obj(port->dev, struct pd_data);
+ port->pd_list[i] = kzalloc_obj(*port->pd_list[i]);
if (!port->pd_list[i]) {
ret = -ENOMEM;
goto put_capabilities;
--
2.53.0