]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cxl/pci: Remove redundant cxl_pci_find_port() call
authorGregory Price <gourry@gourry.net>
Fri, 6 Mar 2026 16:47:41 +0000 (16:47 +0000)
committerDave Jiang <dave.jiang@intel.com>
Mon, 16 Mar 2026 23:31:39 +0000 (16:31 -0700)
Remove the redundant port lookup from cxl_rcrb_get_comp_regs() and use the
dport parameter directly. The caller has already validated the port is
non-NULL before invoking this function, and dport is given as a param.
This is simpler than getting dport in the callee and return the pointer
to the caller what would require more changes.

Signed-off-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Alejandro Lucero <alucerop@amd.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://patch.msgid.link/20260306164741.3796372-5-alejandro.lucero-palau@amd.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/pci.c

index c32cc62c501de3a422b126516c42dea6f53273f5..d1f487b3d809adde0010ae8bc6838e620d7d321a 100644 (file)
@@ -707,11 +707,6 @@ static int cxl_rcrb_get_comp_regs(struct pci_dev *pdev,
                .resource = CXL_RESOURCE_NONE,
        };
 
-       struct cxl_port *port __free(put_cxl_port) =
-               cxl_pci_find_port(pdev, &dport);
-       if (!port)
-               return -EPROBE_DEFER;
-
        component_reg_phys = cxl_rcd_component_reg_phys(&pdev->dev, dport);
        if (component_reg_phys == CXL_RESOURCE_NONE)
                return -ENXIO;