diff mbox series

[v2,13/14] cxl/port: Cleanup adding passthrough decoders

Message ID 20211202043750.3501494-14-ben.widawsky@intel.com
State New, archived
Headers show
Series Add drivers for CXL ports and mem devices | expand

Commit Message

Ben Widawsky Dec. 2, 2021, 4:37 a.m. UTC
This makes the resulting code easier to read and matches similar code
already existing in the port driver.

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
---
 drivers/cxl/port.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/cxl/port.c b/drivers/cxl/port.c
index 527b027dcf24..4100cf395ec3 100644
--- a/drivers/cxl/port.c
+++ b/drivers/cxl/port.c
@@ -243,13 +243,8 @@  static int add_passthrough_decoder(struct cxl_port *port)
 	dport = list_first_entry(&port->dports, typeof(*dport), list);
 	single_port_map[0] = dport->port_id;
 
-	rc = cxl_decoder_add_locked(cxld, single_port_map);
-	if (rc)
-		put_device(&cxld->dev);
-	else
-		rc = cxl_decoder_autoremove(&port->dev, cxld);
-
-	if (rc == 0)
+	rc = add_hdm_decoder(port, cxld, single_port_map);
+	if (!rc)
 		dev_dbg(&port->dev, "add: %s\n", dev_name(&cxld->dev));
 
 	return rc;