Skip to content

Commit 7ea488c

Browse files
jbrun3tMani-Sadhasivam
authored andcommitted
PCI: endpoint: pci-epf-vntb: Return -ENOENT if pci_epc_get_next_free_bar() fails
According the function documentation of epf_ntb_init_epc_bar(), the function should return an error code on error. However, it returns -1 when no BAR is available i.e., when pci_epc_get_next_free_bar() fails. Return -ENOENT instead. Fixes: e35f56b ("PCI: endpoint: Support NTB transfer between RC and EP") Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> [mani: changed err code to -ENOENT] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20250603-pci-vntb-bar-mapping-v2-1-fc685a22ad28@baylibre.com
1 parent 19272b3 commit 7ea488c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pci/endpoint/functions/pci-epf-vntb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ static int epf_ntb_init_epc_bar(struct epf_ntb *ntb)
680680
barno = pci_epc_get_next_free_bar(epc_features, barno);
681681
if (barno < 0) {
682682
dev_err(dev, "Fail to get NTB function BAR\n");
683-
return barno;
683+
return -ENOENT;
684684
}
685685
ntb->epf_ntb_bar[bar] = barno;
686686
}

0 commit comments

Comments
 (0)