pci_epf_make() overwrites the actual error returned by pci_epf_create()
with -EINVAL, which hides the real failure reason. Use PTR_ERR(epf) instead
and print the error code.
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260227030701.40533-1-alok.a.tiwari@oracle.com
epf = pci_epf_create(epf_name);
if (IS_ERR(epf)) {
- pr_err("failed to create endpoint function device\n");
- err = -EINVAL;
+ err = PTR_ERR(epf);
+ pr_err("failed to create endpoint function device: %d\n", err);
goto free_name;
}