Skip to content

Commit d537d95

Browse files
Gregory Pricedavejiang
authored andcommitted
cxl/pci: Remove redundant cxl_pci_find_port() call
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>
1 parent 58f2893 commit d537d95

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

drivers/cxl/core/pci.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -707,11 +707,6 @@ static int cxl_rcrb_get_comp_regs(struct pci_dev *pdev,
707707
.resource = CXL_RESOURCE_NONE,
708708
};
709709

710-
struct cxl_port *port __free(put_cxl_port) =
711-
cxl_pci_find_port(pdev, &dport);
712-
if (!port)
713-
return -EPROBE_DEFER;
714-
715710
component_reg_phys = cxl_rcd_component_reg_phys(&pdev->dev, dport);
716711
if (component_reg_phys == CXL_RESOURCE_NONE)
717712
return -ENXIO;

0 commit comments

Comments
 (0)